Quantcast
Channel: Adobe Community : Popular Discussions - JavaScript
Viewing all articles
Browse latest Browse all 12130

Change field color to red

$
0
0

I have sets of check boxes in an Acrobat form. The user can is required to select one or more of the check boxes in each set. Leveraging off of a previous post by Try67, I was able to create a hidden required text field that alerts users when the click the SUBMIT button if they have skipped the check boxes. This is the custom calculation script used in the hidden text field:

 

var checkboxes = ["Select First Checkbox","Select Second Checkbox", "Select Third Checkbox", "Select Fourth Checkbox"];

var v = "";

for (var i in checkboxes){

if (v=="" && this.getField(checkboxes[i]).value!="Off")

v = "OK";

}

event.value = v;

 

That's working great. However, it is difficult for the user to figure out which fields they missed since the check boxes don't turn red like other form fields that are required.

 

What can I add to this script that would make the check boxes turn red if none of them are checked when the Submit button is clicked -- and is it even possible?

Would appreciate any help you're able to offer. Thanks.


Viewing all articles
Browse latest Browse all 12130

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>