John Lindal![]()
Utility for validating the values of form elements based on CSS classes. Used by FormManager and QuickEdit.
Example showing how FormManager uses it.
<script src="http://yui.yahooapis.com/3.5.1/build/yui/yui-min.js"></script>YUI({
//Last Gallery Build of this module
gallery: 'gallery-2012.05.23-19-56'
}).use('gallery-formmgr-css-validation', function(Y)
{
var e = this.form.elements;
for (var i=0; i<e.length; i++)
{
var e_id = e[i].id;
var msg_list = this.validation_msgs[e_id];
var info = FormManager.validateFromCSSData(e[i], msg_list);
if (info.error)
{
this.displayMessage(e[i], info.error, 'error');
status = false;
continue;
}
if (info.keepGoing)
{
// perform other validations
}
}
return status;
});
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info