iterate through and push SPECIFIC checkboxes to array
Hello,
I have a document with a lot of different checkboxes and they all have their own specific category.
I have the document so that when a user clicks on a checkbox under that specific category, a button displays a value of the number of checkmarks that are clicked under that specific category. The program will only display a value, if the checkbox string value is in the array which I DEFINE.
I have had to manually type in the specific checkbox name into array to get this done, but I am looking to see if I can iterate through and select a specific set of checkboxes to then PUSH to an array, so I don't have to manually type the string names of 100+ checkboxes.
Here is the code that I put in my custom calculation script of the text field which displays the number of checkboxes typed in:
var checkboxes = ["holter-48hr", "holter-72hr", "holter-1wk", "holter-2wk", "cardio-ecgharmonic", "cardio-loop", "cardio-restingecg", "cardio-gxt" ];
var counter = 0;
for (var i in checkboxes) {
if (this.getField(checkboxes).value!="Off") counter++;
}
if (counter < 1 ) event.value = "";
else event.value = counter + "C";
so I have only 2 questions:
1) Is it possible to iterate through a bunch of string values and select them based on the presence of a certain word?
2) Can I toggle the text field to hide (the one above which the script applies to), if the counter value is zero?
Thank you!
