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.

How to script an if/then statement with a check box and calculated form?

Avatar

Level 1

Any help would be much appreciated! (It's time-sensitive, as well, so the quicker the better.) I'm using Livecycle Designer 8.0.

I'm looking to script an if/then statement and apply it the the check box next to "New member". Here's what I want it to do:

- If a user checks "New member" check box, then a calculated number appears in the "New member's dues" numeric field.

- Additionally, the "New member's dues" numeric field should be calculated as a sum of "Annual dues (total)" multiplied by 0.50.)

- Moreover, is there a way to take this a step further and make the "New member's dues" numeric field AND the two check boxes ($198 minimum, $5,150 maximum) hidden unless the "New member" check box is checked?

I'm pretty familiar with the if/then javascripts, but for some reason I just can't figure this one out.

Help.jpg

Thank you, in advance, if you can help!

2 Replies

Avatar

Level 10

Hi Melissa,

In the change event of the New Member check box you should write

if (this.rawValue == 1){

     chkMin198.presence = "visible";

     chkMax5150.presence = "visible";

} else{

     chkMin198.presence = "hidden";

     chkMax5150.presence = "hidden";

}

Avatar

Level 1

Hi, Robert,

Thanks so much for you prompt response.

That script works perfectly! Unfortunately, I’m also looking for a script to apply to the “New member’s dues” numeric field. I would like the “New member” check box, when checked, to make the “New member’s dues” numeric field visible AND to multiply the “Annual dues total” by 0.50 (50%). When the “New member” check box is left un-checked, the “New member’s dues” numeric field should be hidden, as well as the min/max check boxes.

Again, thank you SO MUCH for your help,