Created
February 24, 2012 14:29
-
-
Save JoeChapman/1901243 to your computer and use it in GitHub Desktop.
Defines types validation
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
(function($, window, validator, undefined) { | |
validator.types = { | |
isValidEmail: { | |
validate: function(value) { | |
return '/^$/'.test(value); | |
}, | |
instructions: 'Please enter a valid email address', | |
errorHandler: function() { | |
validate.instructions; | |
} | |
}, | |
notEmpty: { | |
validate: function (value) { | |
return value !== ''; | |
}, | |
instructions: 'field cannot be empty' | |
} | |
}; | |
}(jQuery, window, (validator || {}))); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment