Jquery validate - check which rule is not fullfiled?

I have figured out how to do this by examining source of jQuery validate plugin, so I made my own function to tap into it.

I have figured out how to do this by examining source of jQuery validate plugin, so I made my own function to tap into it: $.validator.prototype. RuleValidationStatus = function( element ) { element = $(element)0; var rules = $(element).rules(); var errors ={}; for (var method in rules ) { var rule = { method: method, parameters: rulesmethod }; try { var result = $.validator.methodsmethod. Call( this, element.value.

Replace(/\r/g, ""), element, rule. Parameters ); errorsrule. Method = result ; } catch(e) { console.

Log(e); } } return errors; } Usage is simple: $("#myform").validate(). RuleValidationStatus($("#myField")) And sample result is: { required : true, regex : true, maxlength : true, remote : false, __dummy__ : true } From this object it is easy to see what rules are not satisfied.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions