This works:
$("[id$='_zzz']").rules(
"add",
{
required: true,
minlength: 8,
messages: {
required: "...",
minlength: jQuery.format("...")
}
}
);
The error message comes up.
When I try to style the message, this doesn't work:
$("[id$='_zzz']").rules(
"add",
{
required: true,
minlength: 8,
messages: {
required: "...",
minlength: jQuery.format("...")
},
errorElement: "span",
errorPlacement: function(error, element) {
error.insertAfter(element);
error.css("margin", "0 0 0 5px");
}
}
);
When I style via the validate function, the styling is applied so it works:
$('#aspnetForm').validate({
errorElement: "span",
errorPlacement: function(error, element) {
error.insertAfter(element);
error.css("margin", "0 0 0 5px");
}
});
Why can't I style using errorplacement in the rules add function?