Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session

Changing Checkbox options based on variables

Avatar

Former Community Member
What I need to create is an area that has 5-8 check-boxes, but the text beside those check boxes will change based an option that is selected in a drop down menu elsewhere in the file.

The reason I need to do this is due to lack of space and better work flow.



Can anyone help with this or any other possible way to do it?



I have used LiveCycle but not much coding.



Thank you in advance.
4 Replies

Avatar

Former Community Member
You could change the caption of the checkboxes by using javascript..



on the CHANGE event of a drop down list, you could add script similar to:



if (xfa.event.newText == "Yes") // (if yes is selected in the dropdown)



xfa.resolveNode("CheckBox1.caption.value.#text").value = "Rooster"; // (change the check box caption to 'Rooster')



else



if (xfa.event.newText == "Maybe")



xfa.resolveNode("CheckBox1.caption.value.#text").value = "Broccoli";



P.S. Make sure you save the form as a dynamic form rather than static!

Avatar

Former Community Member
by the way, the above solution only changes the captions & not the checkbox. the checkbox property name won't change.. if you want a different checkbox / property for each different caption, you might have to create all the checkboxes in design time, and then hide & show checkboxes depending on the dropdown selections

Avatar

Former Community Member
Thank you so much for your help.

I am only trying to change the captions.

From reading the code, it seems everything should work but I'm still having some trouble making it work.

Would you mind clarifying it a bit in the steps?

I am not very familiar with JavaScript or LiveCycle Designer.



Thank you so much in advance.

Avatar

Former Community Member
If you don't mind, please send me the form.. (MASHDOWN45 AT GMAIL DOT COM) otherwise I cannot know what is wrong..