How can I change the error message of jQuery validation so when it validates the error is composed as bullet points inside a jQuery Ui modal dialog.
Tried this but it doesn't work as expected (i.e. the modal dialog only apperas once, but after it is closed, I can't bring the modal dialog back when submitting invalid data for second time).
Any tips will be appreciated. Thank you.
...
$("#myform").validate({
debug: true,
errorPlacement: function(error, element) {
error.prependTo('#dialog-message');
},
errorLabelContainer: $("dialog-message ul"),
onblur: false,
onkeyup: false,
onsubmit: true,
wrapper: "li",
showErrors: function() {
//$("#dialog").dialog("destroy");
$("#dialog-message").dialog({
modal: true,
buttons: {
Ok: function() {
$(this).dialog('close');
}
}
});
this.defaultShowErrors();
}
});
...
<div id="dialog-message" title="Download complete">
<p>test</p>
</div>