I am using this amazing script for validating my form and for the normal functionality it works great, but I would like to validate the form on a onClick (a href) event instead on the submit (input).. is that possible?
Script: https://github.com/jzaefferer/jquery-validation
It must be something like this, right?
<a href="#" onClick="validate()" >
The jQuery validation plugin hooks to the
submit
event of the form. Therefore all you need to do is make the click of thata
element submit the form. Try this:You can call the valid() method on the form to see whether it is valid.
I would recommend adding the handler using jQuery rather than inlining it