gpt4 book ai didi

jquery 与 Coldfusion cfc 和复选框集成

转载 作者:行者123 更新时间:2023-12-01 08:10:17 25 4
gpt4 key购买 nike

我是 jquery 新手,想要完成以下任务。
1) 单击按钮时生成并显示表单

2) 让用户使用该表单上的复选框来指示他们要将电子邮件发送给谁

3)对于对话框中的每个复选框,使用cfmail向该人发送电子邮件(我可以写这部分)

请参阅下面我的代码的开头。

<script>
$(document).ready(function() {

$("#notifyregs").click(function() {
var initialDiv = this;
// HELP - set the checked box values

var reminderemails = $(this).data("reminderemails");
var count = 0;

$("#editForm").dialog({ width: 500, height: 'auto', maxHeight: 1000,
buttons: {
"Send Emails": function() {
var thisDialog = $(this);
// HELP - Loop through reminderemails and send each value to the function sendreminders
$.post("tsafunctions.cfc", {
method: 'sendreminders',
reminderemails: $("#reminderemails").val(),
},
function() {
$("#message").show();
$("#message").text('You sent reminders to ' + count + ' athletes');
$(thisDialog).dialog("close");
});
}
}
});
});

});
</script>

表格

  <div id="editForm" title="Notify Incomplete Registrations">
Check who to send emails to:<br />
<input type="checkbox" name="reminderemails" value="123456" checked="checked" />
<input type="checkbox" name="reminderemails" value="234567" checked="checked" /></td>
</div>

最佳答案

试试这个:

selectedEmails=jQuery('#editForm :checkbox:checked').serialize();

在 jQuery.post 中有一个用于传递数据的数据选项:

$.post("tsafunctions.cfc", {data:selectedEmails, ...});

关于jquery 与 Coldfusion cfc 和复选框集成,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14106560/

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