I’ve been going nuts, and I can’t seem to figure how to stop the page from refreshing when submitting a form via ajax.
I’ve set up a jsfiddle for you to look at: this link
I’ve done the event.prefentDefault() and return false; but can’t seem to get it working. Am I just being stupid?
The end result should be that when the form is submitted, the form area should dissappear and be replaced by the “hidden” ajax_message which simple reads: “check your phone”.
Thanks in advance for saving my hairline 🙂
I fixed your fiddle:
http://jsfiddle.net/ntJux/5/
I just assigned the event handler unobtrusively, as in: