Created
May 16, 2012 14:25
-
-
Save wholypantalones/2710740 to your computer and use it in GitHub Desktop.
jQuery validate notEqual function
This file contains 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
//usage | |
NEW_PASSWORD: { | |
required: true, | |
minlength: 7, | |
notEqual: "#OLD_PASSWORD", | |
}, | |
//function | |
jQuery.validator.addMethod("notEqual", function(value, element, param) { | |
return this.optional(element) || value != $(param).val(); | |
}, "Please specify a different (non-default) value"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment