Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.

Hide and Unhide Subforms with Radio Buttons

Avatar

Level 2

Hello -

I have a pdf form which I created in LiveCycle Designer and am having an issue.  I have three radio buttons on my form which when one is active a particular subform should become visible while the other two remain hidden. I have put the code that I have used to do this which I found on another forum and seemed to have matched my requirements, but I cannot get the code to work on my form.  Any help would be appreciated as this is a form that our company is waiting for me to complete.

<font typeface="Myriad Pro"/>
            <margin bottomInset="0.5mm" leftInset="0.5mm" rightInset="0.5mm" topInset="0.5mm"/>
            <para vAlign="middle"/>
         </draw>
         <exclGroup name="RadioButtonList" x="34.925mm" y="66.675mm">
            <?templateDesigner itemValuesSpecified 1?>
            <field h="6mm" w="53.975mm">
               <ui>
                  <checkButton shape="round">
                     <border>
                        <?templateDesigner StyleID apcb4?>
                        <edge stroke="lowered"/>
                        <fill/>
                     </border>
                  </checkButton>
               </ui>
               <font typeface="Myriad Pro"/>
               <margin leftInset="1mm" rightInset="1mm"/>
               <para vAlign="middle"/>
               <caption placement="right" reserve="47.975mm">
                  <para vAlign="middle"/>
                  <font typeface="Myriad Pro"/>
                  <value>
                     <text>1</text>
                  </value>
               </caption>
               <items>
                  <integer>1</integer>
               </items>
               <value>
                  <text>1</text>
               </value>
            </field>
            <field h="6mm" w="53.975mm" x="53.975mm">
               <ui>
                  <checkButton shape="round">
                     <border>
                        <?templateDesigner StyleID apcb4?>
                        <edge stroke="lowered"/>
                        <fill/>
                     </border>
                  </checkButton>
               </ui>
               <font typeface="Myriad Pro"/>
               <margin leftInset="1mm" rightInset="1mm"/>
               <para vAlign="middle"/>
               <caption placement="right" reserve="47.975mm">
                  <para vAlign="middle"/>
                  <font typeface="Myriad Pro"/>
                  <value>
                     <text>2</text>
                  </value>
               </caption>
               <items>
                  <integer>2</integer>
               </items>
            </field>
            <field h="6mm" w="57.15mm" x="107.95mm">
               <ui>
                  <checkButton shape="round">
                     <border>
                        <?templateDesigner StyleID apcb4?>
                        <edge stroke="lowered"/>
                        <fill/>
                     </border>
                  </checkButton>
               </ui>
               <font typeface="Myriad Pro"/>
               <margin leftInset="1mm" rightInset="1mm"/>
               <para vAlign="middle"/>
               <caption placement="right" reserve="51.15mm">
                  <para vAlign="middle"/>
                  <font typeface="Myriad Pro"/>
                  <value>
                     <text>3</text>
                  </value>
               </caption>
               <items>
                  <integer>3</integer>
               </items>
            </field>
            <event activity="change" name="event__change">
               <script contentType="application/x-javascript">
switch (this.rawValue) {
     case "1":
          form.1.page1.subform1.presence = "visible";
          form.1.page1.subform2.presence = "hidden";
          form.1.page1.subform3.presence = "hidden";
          break;
     case "2":
          form.1.page1.subform1.presence = "hidden";
          form.1.page1.subform2.presence = "visible";
          form.1.page1.subform3.presence = "hidden";
          break;
     case "3":
          form.1.page1.subform1.presence = "hidden";
          form.1.page1.subform2.presence = "hidden";
          form.1.page1.subform3.presence = "visible";
          break;
     default:
          break;
}
</script>
            </event>

1 Reply

Avatar

Level 6

We need more information.

Can you copy your code and post it here?

And what is the form "not" doing?