I know that to add a validator with jQuery you would do something like this:
$(document).ready(function() {
$("#form1").validate({
rules: {
<%=txtUserName.UniqueID %>: {
maxlength: 5,
}
But how would I add to the rules from the code behind, say for example add the required rule to the textbox.
How would I go about doing that?
Thanks in advance.
Solve this by building up a string query with the StringBuilder then registering the script on the page with :