Switch from form submit to AJAX call