jQuery - How to dynamically add a validation rule
- by Justin
Hey,
I'm trying to dynamically add a validation rule to some dynamic controls:
$("input[id*=Hours]").rules("add", "required");
However this line gives me the following error:
$.data(element.form, "validator") is null
Defining rules the static way with the validate function works fine. What am I doing wrong?
Thanks,
Justin