http://bassistance.de/jquery-plugins/jquery-plugin-validation/ looks to be the best jquery validation plugin out there. I can\'t seem to get it working in the jQuery UI dial
You can use the valitidy jquery plugin
The javascript
function validateForm(){
$.validity.start();
// Required:
$("#recipientFirstName").require();
var result = $.validity.end();
return result.valid;
}
$(document).ready(function() {
$('#dialog').dialog({
autoOpen: false,
title: 'My title',
width: 600,
modal: true,
buttons: {
"Ok": function() {
if(validateForm()) {
saveOrder();
$(".validity-tooltip").css("display", "none");
$(this).dialog("close");
}
},
"Cancel": function() {
// The following line was added to
// hide the tool-tips programmatically:
$(".validity-tooltip").css("display", "none");
$(this).dialog("close");
}
}
});
})