I am trying to create a check list that if the user selects an option other fields appear.
example: checklist A,B,C
if A then show option 1
if B then show option 2
if C then show option 3
so if A and B are checked then I want to see 1 and 2 and so on.
Currently my code only shows if one is checked:
def 1Field = getFieldByName("Option 1")
def 2Field = getFieldByName("Option 2")
def 3Field = getFieldByName("Option 3")
def checklistField = getFieldById(getFieldChanged())
if (checklistField.getValue()=="A") {
1Field.setHidden(false)
1Field.setRequired(true)
}
else if (checklistField.getValue()=="B") {
2Field.setHidden(false)
2Field.setRequired(true)
}
else if (checklistField.getValue()=="C") {
3Field.setHidden(false)
3Field.setRequired(true)
}
else {
1Field.setHidden(true)
1Field.setRequired(false)
2Field.setHidden(true)
2Field.setRequired(false)
3Field.setHidden(true)
3Field.setRequired(false)
}