Using LiveCycle to create a form containing a table. This table has 3 columns with 15 check boxes in each column.
Below these 15 rows are 3 more check boxes that have calculated values. In each row of the table only one of the check boxes can be checked at a time.
Based on the majority of choices in a certain column, the corresponding calculated check box should be checked. (If the most choices are made in column 1, then the 1st calculated check box must be checked, etc...)
The trouble I'm having is writing the JavaScript code that selects the correct calculated check box. Currently I'm just trying to figure it out with only the top 3 rows and I can replicate the pattern after.
Ex. of table: (Bold represents calculated)
CheckBox20 | CheckBox35 | CheckBox50 |
CheckBox21 | CheckBox36 | CheckBox51 |
CheckBox22 | CheckBox37 | CheckBox52 |
[ ] CheckBox66 | [ ] CheckBox67 | [ ] CheckBox68 |
Here's the code I've come up with so far but it doesn't work right whatsoever, although when I used it just for 2 columns it did work. (just added the part about the third column with the "or" statements)
(In the calculate script of check box 66)
//larger values than other columns if ((Row1.CheckBox20.rawValue == "") + (Row2.CheckBox21.rawValue == "") + (Row3.CheckBox22.rawValue == "") > (Row1.CheckBox35.rawValue == "") + (Row2.CheckBox36.rawValue == "") + (Row3.CheckBox37.rawValue == "") || (Row1.CheckBox50.rawValue == "") + (Row2.CheckBox51.rawValue == "") + (Row3.CheckBox52.rawValue == "")) {this.rawValue = "0";} //smaller values than other columns if ((Row1.CheckBox35.rawValue == "") + (Row2.CheckBox36.rawValue == "") + (Row3.CheckBox37.rawValue == "") || (Row1.CheckBox50.rawValue == "") + (Row2.CheckBox51.rawValue == "") + (Row3.CheckBox52.rawValue == "") > (Row1.CheckBox20.rawValue == "") + (Row2.CheckBox21.rawValue == "") + (Row3.CheckBox22.rawValue == "")) {this.rawValue = "1";}
I'm new to JavaScript so all advice is appreciated.