Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.

Check boxes

Avatar

Level 1

I am trying to create my first form with LiveCycle and I would like to if this is possible?

If someone checks a check boxes I would like other boxed related to that check box appear

For example

IF checkbox1 = TRUE then show checkbox2, checkbox 3 etc

4 Replies

Avatar

Level 10

Hi,

Yes this is very possible.

You would neec to put some Javascript (or Formcalc, the choice is yours, although there are some slight differences in the language syntax).

if (this.rawValue == 1)  //1 being the "on" or ticked value

{

     checkBox2.presence = "visible";

     checkBox3.presence = "visible";

}

else

{

     checkBox2.presence = "hidden"; //can also go for "invisible"

     checkBox3.presence = "hidden";

}

There are a couple of choices where to put this script. If you put it in the exit or mouseUp event then it will activate when the user exits the first checkBox. But the visibility may revert when you re-open the form. We tend to copy the script into the initialise event as well so that when the form opens it checks the value of the first checkBox and sets the visibility of the other objects accordingly.

Good luck,

N.

Avatar

Level 1

Hi Niall,

Thanks for the information but the script does not seem to work :-(

I have put the script in initialise, exit and mouse up. It does hide the other check boxes when the form is not shown but when I "check" the box it does not show the other check boxes.

Any ideas?

M

Avatar

Level 10

Hi,

The Exit and mouseUp events are very similar and the script should be in one or the other. I would go for the mouseUp, as the changes will happen without the user having to change the focus to the next field.

A couple of things to check:

  1. That the language is Javascript;
  2. That the form is set up as Dynamic and Interactive in the Defaults dialogue window;
  3. That the form is saved as Dynamic.

I have attached (hopefully) a working version for you to look at and see the code in action.

Let me know if you cannot download it and I will email it to you.

Regards,

Niall

Avatar

Level 1

Hi Niall,

Can you please send it to me via email m3d0c@hotmail.co.uk

Many thanks