These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

selected checkboxes to display in another text field

shellm
Registered: Sep 27 2009
Posts: 20

Hi
I am working in Livecycle 8.0 creating a dynamic form

I have 7 checkboxes I need to display which items have been selected in a seperate field i.e

If the user chooses 3 items the names associated with those checkboxes would display in a text box as a list of items.

Does anyone know any code that would do this

My Product Information:
LiveCycle Designer, Windows
xrum
Registered: Feb 25 2009
Posts: 124
on the change even of the check box:

if (this.rawValue = 1)
textBox.rawValue = "some text"
shellm
Registered: Sep 27 2009
Posts: 20
Hi xrum

thanks for the info however I put this code on the change event on the checkbox and renamed textBox to name of my field however it doesn't show up. Should there be a code on the textBox that will show the item in my text box

thanks shellM
shellm
Registered: Sep 27 2009
Posts: 20
Hi

Okay I got this to work just needed to add my sub form. I still have a problem though this only displays one of the checkbox's at a time I need to display up to 7 of these check box answers at the same time in the 1 text field.

thanks
xrum
Registered: Feb 25 2009
Posts: 124
textBox.rawValue = textBox.rawValue + "more text"
xrum
Registered: Feb 25 2009
Posts: 124
though if you uncheck it'll be hard to delete that one value, maybe you should use a diff. text field for each check box? or maybe a list? or a drop down?
gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4308
You could use the following code in the "calculation" for the text field:

// clear text variablesvar sBox1 = ""var sBox2 = ""var sBox3 = ""var sBox4 = ""// get field name if field is checkedif(CheckBox1 <> 0) thensBox1 =  CheckBox1.nameendifif(CheckBox2 <> 0) thensBox2 =  CheckBox2.nameendifif(CheckBox3 <> 0) thensBox3 =  CheckBox3.nameendifif(CheckBox4 <> 0) thensBox4 =  CheckBox4.nameendif// display textConcat(sBox1, ", ", sBox2, ", ", sBox3, ", ", sBox4)

George Kaiser

shellm
Registered: Sep 27 2009
Posts: 20
Hi gkaiseril

I got this to work however I need the information displayed to be stated text as i need spaces and dashes in it and I can't put this in a field name. Is there an additional peice of code which will display a stated name.

Also is possible not to show the comma if the item is not showing in the text field

thanks
shellm