I found where you can add jquery validation rules dynamically like this:
$(\"#ParentAdNumber\").rules(\"add\", { required: true });
But how
$("#ParentAdNumber").rules("remove", "required");
From the documentation: http://docs.jquery.com/Plugins/Validation/rules
Edit: messages
Adding:
$("#ParentAdNumber").rules("add", {
optionName: true,
messages: {
optionName: "message for optionName"
}
});
Removing:
$("#ParentAdNumber").rules("remove", "messages");
Looking at the source code of Validation, it doesn't look like you can remove specific messages...
Simple!
$("#ParentAdNumber").rules("add", {
required: true,
messages: {
required: "Required input"
}
});
you can change the message storing the rule:
var objRule = $("#ParentAdNumber").rules();
Changing:
objRule.messages.required = "New message";
and Re-applying:
$("#ParentAdNumber").rules("add", objRule);
This should do it....
.rules("add", {required: true, messages: {required: "Required input")}