我想在某个文本字段选择ajax自动完成值时显示一个消息框。我正在使用jquery-confirm为此使用 js 库。这是我的代码。
select: function( event, ui ) {
console.log( ui.item.value );
nic= ui.item.value;
$("#msgbox").open();
return false;
}
.
$("#msgbox").confirm({
title: 'Entry Found',
content: 'msg',
lazyOpen:true,
buttons: {
confirm: function () {
$.alert('Confirmed!');
},
cancel: function () {
$.alert('Canceled!');
},
ps:我对 js 和这些 jquery 东西很陌生。:)
最佳答案
试试这个。使用“dialog”代替“confirm”。在“select”中像这样调用。
$("#msgbox").dialog("open");
还有
$("#msgbox").dialog({
title: 'Entry Found',
content: 'msg',
autoOpen: false,
modal: true,
lazyOpen:true,
buttons: {
confirm: function () {
alert('Confirmed!');},
cancel: function () {
alert('Canceled!');}
}
});
关于javascript - 选择值后显示消息框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47802243/