Page 1 of 1

If/Else statement on multiple checkboxes

Posted: 06 Jul 2017
by enillrae
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;
}

Re: If/Else statement on multiple checkboxes

Posted: 06 Jul 2017
by Nikita Kurguzov
Hello, enillrae!
Can you please specify what error are you getting on execution? Console screenshot would be most helpful.