Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Jquery form validation

 
David Mbura
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello guys
I am a beginer in jquery. For some reason Validation wont work....after() wont display error message..what could be wrong?
Thank you in advance.

 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64967
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I see a number of things that could go awry. Firstly, establishing a click handler on a div around the submit button for the form in order to do validation is just, well, rather odd.

Step 1 to cleanup is to get rid of that click handler and replace it with a submit handler for the form. That's the appropriate place to do validation.

And please, next time you post your code, please fix up the indentation properly. Badly indented code is very hard to read.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64967
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
P.S. Why aren't you using the Validation Plugin rather than rolling your own?
 
David Mbura
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you a lot Bear ...i tried to look for the plugin but i didnt find one that suits my needs,from the code ,can you suggest any validation plugin?
Thank you again!
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64967
86
IntelliJ IDE Java jQuery Mac Mac OS X
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic