¡@

Home 

2014/10/16 ¤W¤È 12:04:33

jquery Programming Glossary: jquery.validator.messages.required

Can I copy/clone a function in JavaScript?

http://stackoverflow.com/questions/447658/can-i-copy-clone-a-function-in-javascript

This is easy jQuery.validator.addMethod required function value element param return myRequired value element param jQuery.validator.messages.required So far so good. This works just fine. But what I really want to do is call my function in some cases and the default validator.. if someTest element return myRequired value element param return jQuery.validator.methods.required value element param jQuery.validator.messages.required I looked at the source code for the validators and the default implementation of required is defined as an anonymous method.. at the source code for the validators and the default implementation of required is defined as an anonymous method at jQuery.validator.messages.required. So there is no other non anonymous reference to the function that I can use. Storing a reference to the function externally..

placeholder issue with jQuery Validate

http://stackoverflow.com/questions/6066540/placeholder-issue-with-jquery-validate

placeholders. jQuery.validator.addMethod placeholder function value element return value element .attr placeholder jQuery.validator.messages.required Tag this line at the end of the additional methods.js file. You'll then use it as follows form .validate rules username..