Expand my Community achievements bar.

How to show/hide individual radio buttons in a single radio button list

Avatar

Former Community Member

Can I apply javascript to checkboxes in order to show/hide individual radio buttons in a single radio button list?

2 Replies

Avatar

Level 10

Hi,

Yes, it can be done. You just need to reference the actual button, rather than the radio button group.

It is best if you name the radio button group AND all of the individual radio buttons.

If the radio button group was named "myRadioButtons" and the three rb were named "yesRB", "noRB", and "maybeRB". All of this is in the hierarchy.

Then this script in the click event of the checkbox would work:

if (this.rawValue == 1)

{

     myRadioButtons.maybeRB.presence = "hidden";

}

else

{

     myRadioButtons.maybeRB.presence = "visible";

}

Hope that helps,

Niall

Avatar

Former Community Member

Thanks, Niall,

I'll give it a try . . .

Yours,

Robert Anderson

SWRCB WebSupport

1001 I Street

Sacramento, CA 95814

8th floor 59B

(916) 341-5950

randerson@waterboards.ca.gov

>>> Niall O'Donovan <forums@adobe.com> 8/5/2010 1:47 PM >>>

Hi,

Yes, it can be done. You just need to reference the actual button, rather than the radio button group.

It is best if you name the radio button group AND all of the individual radio buttons.

If the radio button group was named "myRadioButtons" and the three rb were named "yesRB", "noRB", and "maybeRB". All of this is in the hierarchy.

Then this script in the click event of the checkbox would work:

if (this.rawValue == 1)

{

myRadioButtons.maybeRB.presence = "hidden";

}

else

{

myRadioButtons.maybeRB.presence = "visible";

}

Hope that helps,

Niall