Highlighted

Checkboxes in Licecyle

Avatar

Guest

31-07-2008

I know if you use radio button group then the user can only check one box out of whatever many is in the group. But say if your using 4 checkboxes but you want the user to be only allowed to pick one then I am assuming you have to use code. Now do you use FormCalc or Javascript? and then what is the code to do that? Basically if they click on checkbox1 then checkbox2, 3 and 4 should be blank then if they click on checkbox2 then checkbox1, 3 and 4 should be blank.

Replies

Highlighted

pguerett

31-07-2008

You cna write code or an easier way is to use radiobuttons and change their appearance to look like checkboxes. In the Object Paltte under the field tab there is an appearance dropdown. Change it to a solid square and voila ....mutually exclusive checkboxes.



Hope that helps
Highlighted

Avatar

Guest

31-07-2008

This is the Javascript code I put in to test the chickboxes in the "click" event but it still does not work. This is for first CheckBox1.



document.getElementById("CheckBox2").checked=false;

document.getElementById("CheckBox3").checked=false;

document.getElementById("CheckBox4").checked=false;
Highlighted

Avatar

Guest

01-08-2008

Try the following javascript:

if(CheckBox1.rawValue ==1)

{

CheckBox2.rawValue =0

CheckBox3.rawValue =0

CheckBox4.rawValue =0

}

remember to save as dynamic pdf.



I hope this helps you.
Highlighted

Avatar

Guest

01-08-2008

Thank You Daniel this worked perfectly. I know you can use radio buttons to this but the form I was working on was very old and contained subforms within subforms and it was just a mess. When I use the radio buttons it just doesn't join them in a group so I had to use checkboxes and this code works exactly fine with the click function. Thanks again.