Created
March 14, 2016 21:55
-
-
Save uhtred/8adfddd1043d22e003a2 to your computer and use it in GitHub Desktop.
JS: Jquery Validate Custom
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $.validator.addMethod("cMinlength", function(value, element, param) { | |
| var isValid = $.validator.methods.minlength.call(this, value, element, param.length); | |
| $.validator.messages['cMinlength'] = param.message; | |
| return isValid; | |
| }); | |
| $.validator | |
| .addClassRules({ | |
| 'validate-name': { | |
| cMinlength: { | |
| length: 6, | |
| message: $.validator.messages.clientName | |
| } | |
| } | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment