我有一个嵌套表单的 jquery 对话框,如下所示:
<!-- Store Location Dialog -->
<div id = "changeDialog">
<form id = "form" method = "post" action = "Default.aspx" \>
<input type = "text" id = "changeText" name = "changeLocation" />
<input type = "button" id = "changeStoreDialogSubmit" value = "" onclick = "dialogSubmitForm()"/>
</form>
</div>
单击按钮时可能会发生两种情况。一个实例需要页面加载,而另一个则不需要。我的非页面加载实例正常工作,但另一个没有。这是dialogSubmitForm()
我的方法:
function dialogSubmitForm() {
if (!placeHolderVisibility) {
$('#changeStoreDialogSubmit').submit();
}
else /
{
//Working code
}
}
这是对话框:
function createDialog() {
//Creates a new dialog
$('#changeDialog').dialog({
resizable: false,
title: '<span class="ui-icon ui-icon-home"></span> Enter Info',
});
}
当我测试页面时,我可以看到$('#changeStoreDialogSubmit').submit();
被击中,但从来没有页面加载。为什么会发生这种情况?