Is it possible to have a jquery validation code on a form element directly inside the form element?
Example, say I have a textbox… Could I set it up like this…
<input type="submit" name="submit" validation="Here is where you place Jquery Validation Code that would execute onSubit of form">
I thought I saw that online some where while I was searching for something else… It would be great if you could do that, because it would really be what I need… Unfortunately, life is never so sweet…
But say you were generating your form elements on the fly, and you wanted each individual element to have a slightly different validation code to be run by jquery that would give you a false or a true if not met…
How would you manage to do that?
Thanks,
Derek
I dont know about doing it like that but have you looked at this plugin: http://bassistance.de/jquery-plugins/jquery-plugin-validation/ ?
Basicly, if you would have HTML like this:
And the form this is in has id signupForm, you would just do this:
Edited example with 2 rules. See the plugin documentation for details.