I have a dialog opening after a form is submitted using the ajaxForm plugin. The ajaxForm updates the dialog content.
The problem is that an extra dialog is opening. Here's the javascript code:
function formSubmit(target, form, success){
var formoptions = {
target: target,
success: success
};
$(form).ajaxForm(formoptions);
}
function createDialog(element){
$(element).dialog({
modal: true,
autoOpen: false,
buttons: {
Ok: function() {
$(this).dialog('close');
}
}
});
}
in my load function:
createDialog(".formresponse");
$(".contact_submit").click(function(){
formSubmit('.formresponse', '.submitform', function(){
$('.formresponse').dialog('open');
});
});