This content has been marked as final.
Show 1 reply
-
1. Re: Validate that one or more checkbox are ticked.
Varma_LC Apr 14, 2009 11:05 AM (in response to John.Kordas)This is what I would do.....
1. Set up a Global Variable under File>>Form Properties>>Variables Tab
//Variable declared here are always considered string
Example: GCheckCount and set the initial value 0
2. For each CheckBox I would add the following code under "change" event
if (this.rawValue == 1) {
GCheckCount.value = "" + GCheckCount.value + 1;
}else {
GCheckCount.value = "" + GCheckCount.value - 1;
}
3. Also for each CheckBox I would add the following code under "docReady" event to get the initail count
if (this.rawValue == 1) {
GCheckCount.value = GCheckCount.value + 1;
}
4. When you validate do the following
if (GCheckCount.value == "0") {
app.alert("Please select one or more checkboxes.");
}

