What is the name of Checkboxes?
What script did you try to use and where?
For one particular question, box checkboxes (Yes and No) are named pg2_Q1.Check1
I used the script below in the checkbox properties Action setup:
event.target.fillColor = (event.value=="") ? color.yellow : color.transparent;
As I mentioned, this script works for my text fields, but not the checkbox fields.
Since they are mutually exclusive, you need to access their individual widgets, first checkbox has widget 0 and second 1, like this:
Run this script in both checkboxes as Mouse UP action:
var c1 = this.getField("pg2_Q1.Check1.0");
var c2 = this.getField("pg2_Q1.Check1.1");
c1.fillColor = c1.value == "Yes" ? color.white : color.yellow;
c2.fillColor = c2.value == "No" ? color.white : color.yellow;
Thanks for this information! A couple of questions:
1) What do you mean by accessing their individual widgets? Do I just rename each one?
2) How do I get the checkbox to highlight/unhighlight each time the checkbox is checked/unchecked? It will highlight when blank, but, not unhighlights once checked.
1. Because they share the same name, if you don't access their widget, the script will apply to all checkboxes.
The first field that is created is widget 0 second field is widget 1...etc. If you look at my script, you will see that I added .0 and .1 to the checkbox name, that means the script will apply to that checkbox only.
2. If you did everything as I explained, the checkbox should highlight/unhighlight when checked/unchecked.
Make sure your checkboxes have export value of "Yes" and "No".
Thanks for explaining the widgets. I've entered the code exactly as you've suggested. It is working for the Yes checkbox now, but, not working for the No checkbox. Any other suggestions?
Can you share your file, so I can take a look at it?