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 were 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.
I want to learn how it works from examples.
What I would do is change the submit button to a button button that way your not confusing the action. After which, you will manually submit the form once it validates. It will look something like this: