Hi, in a Creator form, I have around twenty checkbox fields, named for example "cb1", "cb2", "cb3", etc...
Each of these fields have two options: Done and N/A.
I would like to be able to for each field, if I check "Done", "N/A" is unchecked, and if I check "N/A", "Done" is unchecked. And if I uncheck both, it remains unchecked.
I don't want to repeat the code for all 20 fields, I assume there is a solution to get all the fields, or list them, and then loop, but everything I try doesn't work.
If you have an example to offer me, that would help me a lot, thank you.
Exemple :
- checkBoxFields = {"cb1", "cb2", "cb3", "cb4", "cb5"};
- for each cbField in checkBoxFields
- {
- fieldValue = cbField.values();
- info fieldValue ;
- if (fieldValue.contains("Fait"))
- {
- fieldValue.remove("N/A");
- input.set(cbField, fieldValue);
- }
- else if (fieldValue.contains("N/A"))
- {
- // Décocher "Fait"
- fieldValue.remove("Fait");
- input.set(cbField, fieldValue);
- }
- }