gpt4 book ai didi

javascript - 选择值后显示消息框

转载 作者:行者123 更新时间:2023-11-28 03:53:05 24 4
gpt4 key购买 nike

我想在某个文本字段选择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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com