In ASP.Net, I'm adding controls dynamically using jQuery.tmpl.
I'm initializing the validator in the $(document).ready() function
with $("#form1").validate();
, my dynamic controls have class="required"
, and I'm calling $("#form1").valid()
on a click event.
Static controls on the page validate, but controls added dynamically do not. What's wrong here?
Also, the dynamic controls make the validator act weird, showing and hiding the validation message as I click on different controls.
Example: http://jsfiddle.net/wY6xt/2/