私は自分のウェブサイトのバックエンドの送信/再送信メールボタンに取り組んでおり、現在、vars を作成した 2 つの整数を追加する方法を考え出しています。
整数が 0 でない限り、スクリプトは正常に動作します。変数の 1 つが 0 であるかどうかに関係なく、合計を表示する必要があります。よろしくお願いします
function sendResend() {
var selected = Array();
var selectedSend = $(".no:checked").length;
var selectedResend = $(".yes:checked").length;
var totalSendResend = parseInt(selectedSend) + parseInt(selectedSend);
$('input:checked').each(function () {
selected.push($(this).attr('name'));
});
var answer = confirm('You have selected ' + totalSendResend + ' emails. ' + selectedSend + ' New emails will be sent & ' + selectedResend + ' will be resent. Are you sure you want to continue?');
if (answer) {
alert(selected);
}
}