我在我的代碼中使用jQuery .dialog()。 在對話框中我有Form。在對話框的確定按鈕上,我想提交表單...但是它沒有提交代碼。我在對話框中寫了標籤。我寫錯了什麼jQuery對話框相關文章
<div id="dialog-form" title="Create new user">
<p class="validateTips">All form fields are required.</p>
<form id='form1' name='form1' action='next.php'>
<fieldset>
<label for="name">Name</label>
<input type="text" name="name" id="name" class="text ui-widget-content ui-corner-all" />
<label for="email">Email</label>
<input type="text" name="email" id="email" value="" class="text ui-widget-content ui-corner-all" />
<label for="password">Password</label>
<input type="password" name="password" id="password" value="" class="text ui-widget-content ui-corner-all" />
</fieldset>
</form>
</div>
$("#dialog-form").dialog({
autoOpen: false,
height: 300,
width: 350,
modal: true,
buttons: {
OK: function() {
//$(this).dialog("close");
$('#form1').submit();
return true;
},
Cancel: function() {
$(this).dialog("close");
}
},
close: function() {
allFields.val("").removeClass("ui-state-error");
}
});
_delated_代表_delayed_嗎?我不能正確推斷.. – 2011-03-29 13:57:10
這是錯誤的...我已經改變了它 – 2011-03-29 13:59:11
這段代碼對我來說看起來很好 - 你有沒有做過任何調試?你能否說出「確定」按鈕的處理程序是否被調用?是否有任何JavaScript錯誤報告? – Pointy 2011-03-29 14:03:07