Created
December 30, 2010 19:05
-
-
Save brianjmiller/760148 to your computer and use it in GitHub Desktop.
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
/* | |
* Validator Attribute | |
* | |
* @attribute validators | |
* @type {object} | |
* @default {isNumber & customVal} | |
* @since 1.0.0 | |
*/ | |
validators : { | |
value : { | |
isNumber : { | |
test : '^[\d]*$', | |
invalid : '{field} must be only numbers' | |
}, | |
customVal : { | |
test : function(val) { | |
return val === 'i' | |
}, | |
invalid : "{field} didn't meet my requirements" | |
} | |
} | |
}, |
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
var myHighlight = new Y.Highlight ( | |
{ | |
validators: { | |
newValidator: { test: "rofl", invalid: "you messed up man" } | |
} | |
} | |
); | |
// right here what is myHighlight.get("validators")? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment