Skip to content

Instantly share code, notes, and snippets.

@brianjmiller
Created December 30, 2010 19:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brianjmiller/760148 to your computer and use it in GitHub Desktop.
Save brianjmiller/760148 to your computer and use it in GitHub Desktop.
/*
* 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"
}
}
},
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