可能重复:
使用jQuery的是或否确认框
我在这里看到很多关于jQuerys标准确认对话框替换的例子,但是不了解它们中的任何一个.
如果我想使用jQuery或jQueryUI弹出确认对话框.我该怎么做并检索用户点击的按钮?
当然必须有一种简单的方法来设置像alert("Something!");命令一样的确认对话框.
添加两个按钮并设置回调功能yes或no?
function ValidateField(){
var bAllow= true;
//some checking here
if (bAllow == true && apl.val().trim() == "")
{
showDialog();
showDialog().done(function() {
return true; // wanna return true, but not success
}).fail(function() {
return false; //wanna return false, but not success
});
return false; //stop it to execute to next line
}
return bAllow; //success return }
function showDialog(){
var def = $.Deferred();
var modPop = '<div id="diaCom" title="Information?"><p>something something</p></div>';
$("#diaCom").remove();
$(modPop).appendTo('body');
$("#diaCom").dialog({
resizable: false,
draggable: false,
height:150,
width:300,
modal: true,
buttons: …Run Code Online (Sandbox Code Playgroud) 在确认消息框中,如何更改按钮以显示"是"和"否"而不是"确定"和"取消"?有没有办法使用jQuery/Javascript实现这一目标?在此先感谢您的帮助.
如何使用jquery或任何其他方法使用yes no button开发确认对话框?当我点击提交按钮时,我需要确认.