Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session

Populating a Text Field based on Check Box(es) selection.

Avatar

Level 1

Hello Everyone,

I usually work with Acrobat forms and I have been recently needing more Dynamic funtioning of the forms. I need help in that I want to populate a text field based on various checked boxed and radials. In Acrobat I assigned this script to the text field that would change for example:

if(this.getField("ia1").value == 0 && this.getField("ia2").value == 1 && this.getField("cbx2").value == 0)

{

event.target.value = "This letter is to confirm our conversation on " + "<Please Enter Date>" + " reg..... " + this.getField("mon").value + "."; //where please enter date told the user to add the date manually.

}

else if(this.getField("ia1").value == 0 && this.getField("ia2").value == 1 && this.getField("cbx2").value == 1)

{

event.target.value = "This letter is to confirm ...

In LiveCyle I have created a sample form and the check and radials and the text field. When I assign the following script to the text field I am not sure which event to place it in, I also dont know how to get the field to be intereactive after the update such as to let the user enter their own date or know if the value of the radial (Months.rawValue) will input into the final text.:

if(Inv.rawValue == 1 && Reb.rawValue == 1 && Season.rawValue == 1) //where Inv and Reb are check boxes and Season is the radial group

{

txtFld.rawValue = "This letter is to confirm our conversation on " + "<Please Enter Date>" + " reg..... " " + Months.rawValue + " "

}

When I add this to one of the checkboxes using (this.rawValue .... and then the additional script it works but only once I check and uncheck the check box the script is placed in. I have tried this first in the click event and then the change event. As I am fairly new to LiveCycle I need a better understanding of each event. Although I am reading up on this I would ask if someone could provide some assistance in the matter, all is apprecaited.


Thanks in advance,

A A A

1 Reply

Avatar

Level 10

Hi,

You might be better to place the script in the calculate event of the txtFld, as then when any of the referenced fields change, it will automatically fire the script in the calculate event.

There is a summary of events here: http://bit.ly/gW3RNr.

Hope that helps,

Niall