Expand my Community achievements bar.

Enhance your AEM Assets & Boost Your Development: [AEM Gems | June 19, 2024] Improving the Developer Experience with New APIs and Events

How to check/toggle a checkbox in script

Avatar

Level 1

Simple question that I can't seem to find an answer to. I'm building a PDF form using LiveCycle. I have some radio buttons. When I select a particular radio button, I want it to also select/toggle a checkbox, called "checkbox1" for example. I assume that I need to do this in a script. How do I toggle a PDF form checkbox in Javascript?

form1.Body.RadioButton1::click - (javascript, client)

// Toggle form1.Body.checkbox1

2 Replies

Avatar

Level 6

Since your question is about an XFA form, I'm moving this to the LiveCycle Designer forum: LiveCycle Designer

Avatar

Level 10

Hi there, usually checkboxes have the value by default of 0 and 1 as strings : "0" & "1"

Some times checkboxes have different value either because you changed it or it was implemented by another program...

To make sure you want to check a checkbox, the code that will work at any time would be the following

but normally if the value of your checbox is 1 and 0, you can just use this :