Alwyn Alwyn - 1 year ago 105
Javascript Question

Debugging Unobtrusive Validation (client side)

I am using unobtrusive validation. My form is rather complex and on cursory look there's no "visible" validation error.

However when I call:


The result is
. I need to debug why, if there's a hidden element etc. that is somehow tripping off a rule. Or may be even the rule itself may not be appropriate.

How can I debug the validation? I need a property/method that tells me which element is bad, and also the rules that it sets off.

I have tried looking into
also, but could not find anything that seems related to what I'm looking for.

Answer Source

If you use .validate() instead of .valid() it has a property called errorList which contains the offending element and message. The message may be used to track back the rules being broken.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download