| Overview | Index | GodLikeMouse JavaScript Framework |
| FRAMES | NO FRAMES |
GLM.DOM.Validator.getViolations()
Method for returning a list of the validation failures. Each returned validation failure has two properties, "text" the error text associated with the required field and "id", the control id of the required field, "args" additional information passed in.
Returns:
The collection of validation failures.
Example:
var v = new GLM.DOM.Validator();
v.addRequiredField("txtFirstName");
v.validate(); //validate all required fields.
if(!v.isValid){ //check for failures
var violations = v.getViolations(); //return all failures
var s = "";
for(var i=0; i<violations.length; i++){
s += violations[i].text + "\n";
}
alert(s); //alert all violations
}
| Overview | Index | GodLikeMouse JavaScript Framework |
| FRAMES | NO FRAMES |