If/Else statement on multiple checkboxes
Posted: 06 Jul 2017
Hi,
I have a form that has multiple checkboxes. A user can check one or more checkboxes with each checkbox performing a different calculation on the subtotal. I keep getting error on the code below for the first if/else.
var opt=0;
var optValue;
if (fd.field('TaxesDuties').control().el()
.find('input[type="checkbox"]').eq(opt)
.is ('checked') {
optValue= OPT * subTotal;
console.log('OPT: '+optValue);
} else {optValue=0;
}
I have a form that has multiple checkboxes. A user can check one or more checkboxes with each checkbox performing a different calculation on the subtotal. I keep getting error on the code below for the first if/else.
var opt=0;
var optValue;
if (fd.field('TaxesDuties').control().el()
.find('input[type="checkbox"]').eq(opt)
.is ('checked') {
optValue= OPT * subTotal;
console.log('OPT: '+optValue);
} else {optValue=0;
}