Condition based on multiple choise option
Hi
I am trying to set up the condition which will show/hide some accordion tabs based on what check boxes are checked in multiple choice field. here is my code for one:
The idea is if 1st check box is chosen then IFS accordion tab will be shown. But it is not working.... Please help me with setting this condition.
I am trying to set up the condition which will show/hide some accordion tabs based on what check boxes are checked in multiple choice field. here is my code for one:
Code: Select all
function setIFS() {
var checkboxIndex = 1;
fd.field('FinanceSys').control()._el().find('input[type="checkbox"]').eq(checkboxIndex).is(':checked');
if (checkboxIndex != null) {
$('#fd_accordion-0 > h3').eq(0).show();
$('#fd_accordion-0 > div').eq(0).show();
} else {
$('#fd_accordion-0 > h3').eq(0).hide();
$('#fd_accordion-0 > div').eq(0).hide();
}
}
fd.field('FinanceSys').change(setIFS);
setIFS();
- Nikita Kurguzov
- Posts: 889
- Joined: Mon Jul 03, 2017
Dear Katy,
Why not use our JavaScript API to retrieve values from choice field with checkboxes?
A condition like this should do:
Why not use our JavaScript API to retrieve values from choice field with checkboxes?
A condition like this should do:
Code: Select all
if(fd.field('Checkboxes').value().indexOf(0) >= 0) {
//first option selected
}
else {
//first option not selected
}
Cheers
-
- Information
-
Who is online
Users browsing this forum: No registered users and 24 guests