Instead of using the .addMethod() function jquery.validate offers, I’m planning to just add another method inside the jquery.validate.js itself since I’ll be using my custom method for all of the forms I need. Should I proceed on editing the plugin itself? Or is there any other way I can invoke the .addMethod() without calling it redundantly on all my pages?
Hope to get your responses. 🙂
There’s no reason why you can’t extend jQuery validate yourself.
Does it have to be in the same file though? If it was me, I’d add the method in another .js file where my code is stored.
That way, you don’t need to worry about a future developer replacing the validate file in order to prevent some new bug, and borking your code.