These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Required Checkbox Red hightlighting

glennodickson
Registered: Nov 23 2007
Posts: 3

I have had a problem where a grouped checkbox where only one value(checkbox) can be selected.

If a form is submitted with out any values being entered, the red boxes appear as expected highlighting all fields with a Required attribute set. However, when a check box (say 1 out 2 boxes) is selected the other check box remain highlighted in red. This implies that the other box needs to be highlighted, which is misleading.

For example Male and Female checkboxes. Submitting a form with no data highlights both boxes even though they are grouped under Sex. This misleads the user in thinking that the other box requires selection too.

I would like to know if any one has/know how to disable this group of boxes or had similar experiences.

As seen in other posting, it is required to place script behind all fields in order to remove the red box when data is eventually entered. This is the script I have been successfully using for all controls in the Validation event, except for checkboxes :
if (this.isNull)
{
this.validate.nullTest="error";
this.mandatory="error";
false;
}
else
{
this.validate.nullTest="disabled";
this.mandatory="disabled";
true;
}

When I apply this to a checkbox group the boxes no longer highlight is red, as though the ELSE statements success everytime regardless.

if anyone can assist I would greatly appreciate it. I've many things, but I would be very interested if anyone encountered similar behaviour.

Thanks
Glen

e120274
Registered: Nov 25 2007
Posts: 2
Hi Glen,
How about putting radiogruop with square view, instead of check boxes. It has also a problem of not highlighting although giving the required field exception.

Asiye
glennodickson
Registered: Nov 23 2007
Posts: 3
ThanksBut that is my problem : the red highlighting will not disappear. I've tried applying the scripts I used for text boxes highlighting but that script didn't work for the boxes.

By the way the boxes are grouped. I don't think there is much difference between the radio and square boxes except for the cosmetic look.

Thanks
Glenn
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Glennodickson,
e120274 is correct. If you were to use Radio Buttons instead of check boxes you would have no problem, since Radio Buttons are considered part of the same control. But you would have to do the colloring with code.

However, if you wanted to stick with your current setup, then all you have to do is to Add the other check box field(s) into the code for removing the mandatory property.

Is there some reason you are using Check Boxes instead of Radio Buttons? How exactly did you group the check boxes? Radio buttons are part of what's called an exclusion group, is this what you mean? or did you use code to control the mutual exclusion?

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

Dawn W
Registered: Feb 2 2010
Posts: 17
how do you eliminate the red box when 1 of the radio buttons has been selected to indicate that the other boxes are still not required.
web_wolf
Registered: Jan 24 2008
Posts: 39
Yes, I ran into this problem with my required radio buttons. Must be a bug or something.
A work-a-round I found was to manually change the field's settings on the change event.
form.Page1.radiobutton.choice1::change - (JavaScript, client)this.mandatory = "disabled";choice2.mandatory = "disabled";choice3.mandatory = "disabled"; form.Page1.radiobutton.choice2::change - (JavaScript, client)this.mandatory = "disabled";choice1.mandatory = "disabled";choice3.mandatory = "disabled"; form.Page1.radiobutton.choice3::change - (JavaScript, client)this.mandatory = "disabled";choice1.mandatory = "disabled";choice2.mandatory = "disabled";

Website Designer - Lititz, PA

Dawn W
Registered: Feb 2 2010
Posts: 17
where in the properties do you enter the code.
web_wolf
Registered: Jan 24 2008
Posts: 39
You cannot enter code within the properties of the field, you need to open the Script Editor window and enter the code there, with the corresponding field selected.

Website Designer - Lititz, PA