Customising event delegates in the jQuery validation plug-in
- by Russell
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