Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.

Script to turn a check box On

Avatar

Former Community Member
I am wondering if there is a way to use a script (or other LiveCycle method) to turn a checkbox "on" if a text/numeric field has an entry in it?



I'm also having trouble figuring out what "event" to use to make this happen. My forms will be completed automatically with data from a computer program. The user won't see the form, but the information they enter in the User Interface will flow into the form for printing after all questions are answered.



Any help is appreciated!

Karen
1 Reply

Avatar

Former Community Member
You can control what value the checkbox represents when it is off/on. These properties are exposed in the Object palette. Assuming that you set it as On/Off then your code would look something like this:



if (TextFieldName.rawValue != null){

checkboxName.rawValue = "Yes"

}



If this is an interactive form then you can put this code on the exit event of the textField. If this is more of a merge data operation then you can put it on the Doc Ready event of the checkbox.