您可以在对话框窗口打开后尝试加载表单功能吗
编辑 我已经放置了 $(this).dialog('close'); 以上返回假
$( "#dialogbox" ).dialog({
autoOpen: false,
modal: true,
width: 'auto',
show: {
effect: "blind",
duration: 1000
},
hide: {
effect: "explode",
duration: 1000
},
buttons: {
//This function handles passing in the form data generated by getdialogbox.php
'Submit' : function(){
$.ajax({
type: "POST",
url: "include/insertToDB.php",
data: $("#htmlform").serialize(),
success: function(){
$("#htmlform").submit();
}
});
$(this).dialog('close');
return false;
}
},
open: function( event, ui ) {
var $inputs = $('select.titans');
var $controller = $('select.controller');
$('select').change(function(){
if($controller.val() !== ''){
$inputs.prop('disabled', $(this).val() !== '');
$inputs.val('');
}else {
$inputs.prop('disabled',false);
}
});
}
});