Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.

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 :