gpt4 book ai didi

javascript - jquery 对话框按钮周围的表单?

转载 作者:行者123 更新时间:2023-12-03 11:36:46 24 4
gpt4 key购买 nike

我只是想知道是否可以在 jQuery 对话框 中的按钮周围放置一个表单。我环顾四周,并在我正在使用的 JavaScript 中亲自尝试过,但似乎无法让它工作。如果可能的话,我希望它位于按钮“查看未读”周围,因为我需要通过表单将某些内容传递到下一页。

我会发布一张照片,但我的代表不够高:

这是我的代码:

$("#notifiedDiv").dialog({
resizable: true,
height: 300,
width: 400,
autoopen: false,
modal: true,
buttons: {
"View unread": function () {

},
"Ok": function () {

}
}
});

最佳答案

这是老板,但我不推荐它。

而是这样做

"View unread": function () {
$.ajax({
url:"the action url"
data: {"name": "value" } /*key values like name+values of your forms input*/
success:function(data) {
/*do something with the response*/
}
});
},

Check here more info about ajax

关于javascript - jquery 对话框按钮周围的表单?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26463989/

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