How JQuery data validation plugin works on the submit action
- by kwokwai
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.