1 Reply Latest reply on Dec 19, 2016 3:43 AM by joelb79062889

    Form with check boxes to hide unhide subforms

    lanar37171111 Level 1

      I have a form that I am creating in LiveCycle Designer that has multiple check boxes and other fields on page 1.  Page 2 has some standard conditions.  I also have hidden sub forms on page 3 and on, that I want to make visible based on what check boxes are checked.  Is this possible?

        • 1. Re: Form with check boxes to hide unhide subforms
          joelb79062889

          Hey mate,

          Firstly just saying that I'm no expert and i've only been using LC for the last month or so. Have learned plenty though.

           

          Anyway, so you're basically saying that you want to show/hide subforms depending on what checkboxes are checked?

           

          Easiest way to do this would be using 'Actions'. I don't have LC on this PC but i'll try describe it for you. Simply right-click on a check box and Select Actions > Add Action (or something like that). Then you can specify when the box IS checked...THEN, below it you can select the subform you want to appear as the object, and "Show/Hide an object". Then select "Show".

           

          Actions are essentially just a wizard to write a bit of code for you. Also make sure you add another (separate) action to hide the subform when the box is unchecked, so it will toggle.

           

          Second option is just to write some code:

           

          Open up the script editor (View menu), and put this in the "change" event of the checkbox you want to show/hide a subform: Language is Javascript.

           

          if (this.rawValue == "Yes")

          {subformyouwanttoshow.presence = "visible" }

          else

          {subformyouwanttoshow.presence = "hidden" }

           

          change the "subformyouwanttoshow" part to the name of the subform. Easiest way to while you're in the script editor, hold down Ctrl and click on the subform you want to show/hide. A little V comes up when you mouse over it. This should put the relative name of the subform in the script editor for you. This is also assuming that the value of your checked box is set to Yes in the "Binding" tab.

           

          Hope this helps.