Customising event delegates in the jQuery validation plug-in
Posted
by Russell
on Stack Overflow
See other posts from Stack Overflow
or by Russell
Published on 2010-05-04T02:28:50Z
Indexed on
2010/05/04
2:38 UTC
Read the original article
Hit count: 340
I am currently setting up the jQuery validation plug-in for use in our project.
By default, there are some events automatically set up for handling. I.e. focus in/out, key up events on all inputs fire validation. I want it to only fire when the submit button is clicked.
This functionality seems to be in-built into the plug-in, which is making it difficult to do this (without modifying the plug-in code, Not What I Want To Do).
I have found the eventDelegate function calls in the plugin code prototype method:
$(this.currentForm)
.validateDelegate(":text, :password, :file, select, textarea", "focusin focusout keyup", delegate)
.validateDelegate(":radio, :checkbox, select, option", "click", delegate);
When I remove these lines from the plug-in I get my result, however I would much rather do something Outside the plug-in to achieve this.
Can anybody please help me? If you need any more details, please let me know. I have searched google with little success.
Thanks
© Stack Overflow or respective owner