Reputation: 113
I am using the jQuery Validation plugin and I would like to specify dynamically the rules of form:
<input type="text" name="MyText" id="MyText" />
var Rule="Mytext";
$('#someForm').validate({
rules: {
Rule: {
required: true
}
},
messages: {
Rule: {
required: 'Please fill the MyText field'
}
}
});
Upvotes: 3
Views: 1459