View Full Version : Prevent Form Submission

10-11-2008, 05:45 AM
Hello there,

I have a webpage with a text box for subscribing to a mailing list. I use JQuery and a few plugins to validate the email, and only submit it via AJAX if it's valid. The thing is, the form should never be submitted, but if the user presses enter after typing in their email.. the form is actually submitted its not parsed through the validation plugin and sent via AJAX.. how do I fix this?


I've tried using onsubmit.. but it does not work.

Thanks in advance!

10-11-2008, 12:32 PM
debugging JQuery (or any other framework) is an impossible mission, as they use hundreds of silly custom methods and objects. Should you have used a native, plain javascript codes, we could have helped you. Otherwise, you should hope for somebody from the JQuery crew to observe your post and give you a clue.

Using frameworks instead of learning and creating your own javascript code lines will always bring troubles.

10-11-2008, 02:33 PM
Wow, someone has a bad personal opinion on a JavaScript library.

Code appears to be working now, guessing you fixed it?


10-11-2008, 03:00 PM
100 or more lines of code for a email address validation??? lol