How JQuery data validation plugin works on the submit action

Posted by kwokwai on Stack Overflow See other posts from Stack Overflow or by kwokwai
Published on 2010-05-18T18:24:01Z Indexed on 2010/05/18 18:30 UTC
Read the original article Hit count: 262

Filed under:
|

Hi all,

I am learning how to use JQuery validation plugin,
and came across some questions
about the JQuery magic that works on the sumbit action.
I got a simple HTML form which has got an input text field like this:

<form class="cmxform" id="commentForm" method="get" action="">
<input id="cname" name="name" size="25" class="required" minlength="2" />
<input class="submit" type="submit" value="Submit"/>
</form>

The magic happened when I tried not to input any data into the field and pressed the
submit button. I saw an error message in red pop up,
and no matter how hard and how many times
I pressed the submit button, nothing was submitted.

It seemed that there was some scripts that disabled the submit action,
but I just couldn't find which lines of codes in the JQuery Validatyion Plugin that did it.

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about jquery-validate