我想在用户单击我的 aspx 页面中的按钮后显示一个包含 4 个选项的确认框:是/否/全部是/全部否。我看过很多示例,但它只包含是/否选项。请告诉我如何做到这一点。
最佳答案
没有 native JavaScript 函数(我猜您看到了使用 confirm
函数的示例)。
尝试使用 javascript 库来创建伪对话框。
最常用的一个是 JQueryUI 。特别是,看看 the Dialog confirmation
sample ,您将以类似以下内容结束:
<script>
$(function() {
$( "#dialog-confirm" ).dialog({
resizable: false,
height:140,
modal: true,
buttons: {
"Yes": function() {
// Handler for Yes
},
"No": function() {
// Handler for No
},
"Yes to all": function() {
// Handler for Yes to all
},
"No to all": function() {
// Handler for no to all
}
}
});
});
</script>
关于asp.net - 是/否/全部是/全部否消息框 asp.net,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18073704/