This will load the contents myform.htmlinto the element with the identifier formContainer, make a formContainermodal dialog box (showing the form). When you submit the form, the dialog will be closed
$("#formContainer").load("myform.html", function() {
var container = $(this);
container.dialog({
modal: true
})
.find("form").submit(function() {
container.dialog("close");
return false;
});
});
source
share