There are 7 check boxes any or all of which, if checked, will display the text field (and can be checked and unchecked), so it seems easier to script if the text field is showing rather than any/all of the check boxes. This would solve part 1 of a 2 part challenge.
The second scripting challenge would be to add a second condition: what is the current selection chosen in a drop down list box: I am already using:var sNewValue = this.boundItem(xfa.event.newText)
AND depending on which text selection is currently chosen, PLUS if the text field (see above) is currently showing, set/change the fill color of a cell in a table to a RGB value.
New to (JS) scripting LiveCycle, I have not been able to set up these complex conditional statements: while TextField1 is showing, and if the current selection (in the drop down list box) = "xyz", then: Table1.Row1.Cell2.fillColor = "0,128,0", else if, while TextField1 is showing and the current selection is "abc", set the same fill color (or a different color) for a different cell.
I tried the following (click event in a test button) without success:
var sNewValue = DropDownList1.boundItem(xfa.event.newText)
if (sNewValue == "prostate cancer, early onset: < 60")
&& TextField3.presence == "visible"
Table1.Row1.Cell2.fillColor = "0,128,0";
Nothing happened when the test button was clicked.
Any help would be appreciated. (While I would prefer not to post the draft form online, I would be happy to send it via email if someone offering suggestions would like to have a look and provides their email address.)