[英]Is it possible to simulate button clicks or specify default OK & Cancel action handlers in jQuery UI Dialog?
[英]jquery dialog with ok and cancel button
在jQuery對話框中,我只允許對話框中的一個按鈕。 我想在此對話框中有兩個單獨的按鈕
腳本
<script type="text/javascript">
$("[id*=btnclosejob]").live("click", function() {
$("#dialog").dialog({
title: "Job Close?",
buttons: {
Close: function() {
$(this).dialog('close');
}
}
});
return false;
});
</script>
HTML
<asp:Button ID="btnclosejob" runat="server" Text="Close Job" />
<div id="dialog" style="display: none">
Are You Sure You Want to Close this job
</div>
Result
(只有一個按鈕“關閉”,但我要兩個單獨的按鈕分別用於“操作”和“第二個”按鈕以關閉操作面板)
當我單擊確定按鈕時,它應該重定向到其他頁面
只是用逗號添加另一個按鈕?
$("[id*=btnclosejob]").live("click", function() {
$("#dialog").dialog({
title: "Job Close?",
buttons: {
"Close": function() {
$(this).dialog('close');
},
"OK": function() {
window.location = YOUR_URL;
}
}
});
return false;
});
您可以根據需要設置任意數量的按鈕。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.