私は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>