我有一系列對應於條目的複選框,以及一個刪除了我已附加了jquery ui模式確認的所有按鈕。這裏撥弄:http://jsfiddle.net/BxdWc/。問題在於,在確認對話框中按下yes之後,它不會提交表單(未由php處理)。 php代碼包含在頁面的頂部,但我相當確定它與此無關,因爲沒有模式代碼進程,並正確刪除檢查的條目。jquery ui確認對話框不起作用
JS:
$(function() {
$("#dialog-confirm-multiple").dialog({
autoOpen: false,
resizable: false,
width: 300,
modal: true,
show: {
effect: "bounce",
duration: 100
},
hide: "drop",
buttons: {
"Yes": function() {
$("#confirm").submit();
$(this).dialog("close");
},
"No": function() {
$(this).dialog("close");
}
}
});
$("#doDelete").click(function (e) {
e.preventDefault();
$("#dialog-confirm-multiple").dialog('open');
return false;
});
});
HTML:
<form post="self.php" id="confirm">
<!-- some inputs .etc -->
<input name="doDelete" type="submit" id="doDelete" value="Delete" class="btn btn-danger">
</form>
它不提交或不只是'POST'數據? – DevlshOne
不發佈,點擊後頁面重新加載。奇怪的壽,因爲沒有JS,它工作正常 – Alex