Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session

Check value of radiobuttonlist

Avatar

Level 2

I have a radio button that hides and makes subforms visible.  This part works but when I save the filled out form it goes back to the original setting.  I need a way for the subforms to be hidden at startup of the form.  I have done that by hidding the subforms on the initialize script.  This is where my problem is I think because when the form is saved and then opened they are hidden by the initialize script.  Does anyone know how I can have the subforms hidden at the first startup of the form and then hide or make visible depending on the value of a radio button and then when the form is saved it should keep the subforms hidden or visible (depending on the value of the radio button) the next time it is opened.

8 Replies

Avatar

Former Community Member

put the code that you have on your change or exit events of the radiobuttons on the initialize as well

Avatar

Level 2

I have tried that burt my code is

if(this.rawValue == 1)
{

form1.subform1.presence = "visible";
form1.subform2.presence = "visible";
form1.subform3.presence = "visible";
form1.subform5.presence = "visible";
form1.subform8.presence = "hidden";
form1.subform9.presence = "hidden";

}

else

{

form1.subform1.presence = "hidden";
form1.subform2.presence = "hidden";
form1.subform3.presence = "hidden";
form1.subform5.presence = "hidden";
form1.subform8.presence = "hidden";
form1.subform9.presence = "hidden";

}

I don't know how to check the value of the RadioButtonList on initialize of the form.  if (this.rawValue) does not work.

neither does if (form1.#subform[0].RadioButtonList.rawValue)

Any suggestions?

Avatar

Former Community Member

this.rawValue should work on initialize.

can you attach a sample form?

Avatar

Level 2

You are right I guess I did not do it correctly when I tried it before. Thanks for your help.

Avatar

Level 2

This still does not work.  When I save the file if the subforms were visible they are not when you open the file again.

Avatar

Level 2

My form is several pages but this form has the same code in it.  When I enable the rights for Adobe Reader to fill out and save.  After the form is saved it does not hold the value of the radio button.  It looks like it does but the subforms are hidden.

Avatar

Former Community Member

1. your initialize code is under form1, not under the radio buttons. this.rawValue will not work under form.... move the code to the initialize event of the radio buttons

and make sure your Language is set to javascript, not formcalc