Highlighted

Changing Checkbox options based on variables

Avatar

Guest

02-07-2008

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.

Replies

Highlighted

Avatar

Guest

04-07-2008

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!
Highlighted

Avatar

Guest

06-07-2008

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
Highlighted

Avatar

Guest

08-07-2008

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.
Highlighted