Murray Macchio![]()
This non-instrusive component will change your regular forms into highly interactive forms. Fields filled in incorrectly will be highlighted as incorrect, while inputs filled in properly will be shown as correct. Fully customizable, use your own CSS to mark fields as valid or invalid.
Main features include
See full documentation here
http://murdog05.github.com/yui3-gallery/docs/module_validator.html
Below is for a simple html page in which you want the form validator to do all the work. It will create all the validators. See here for example
http://murdog05.github.com/yui3-gallery/examples/json/dynamicValidatorsExample.html
See the inline equivalent here
http://murdog05.github.com/yui3-gallery/examples/inline/dynamicValidatorsExample.html
YUI({
modules: {
'gallery-formvalidator': {
fullpath: 'http://yui.yahooapis.com/gallery-2009.11.19-20/build/gallery-formvalidator/gallery-formvalidator-min.js',
requires: ['dom','node','event','base'],
optional: [],
supersedes: []
}
}
}).use('gallery-formvalidator', function(Y) {
var form2 = new Y.Validator(
{
form:'basicExample2',
defaultIndicatorDomType:'DIV',
defaultIncorrectIndicatorCss:'validator',
defaultCorrectIndicatorCss:'indicator',
createCorrectIndicator:true,
createIncorrectIndicator:true,
correctIndicatorText:'<span class="indicator"> </span>',
incorrectIndicatorText:'<span class="validator"> </span>',
fieldJSON:[
{
type:Y.TextBaseField,
atts:{
inputDOM:'firstName2'
}
},
{
type:Y.TextBaseField,
atts:{inputDOM:'lastName2'}
},
{
type:Y.DoubleField,
atts:{
inputDOM:'income2',
max:40000.00,
maxDecimalPlaces:2
}
},
{
type:Y.IntegerField,
atts:{
inputDOM:'age2',
max:100,
min:10
}
}
]
}
);
});| Subject | Author | Date |
|---|---|---|
| Any comments suggestions or feedback | Murray Macchio | 11/25/09 |
| Re: Any comments suggestions or feedback | Murray Macchio | 11/25/09 |
| Re: Any comments suggestions or feedback | Eric Miraglia | 11/25/09 |
© 2010 YUI Library - Site Credits