Expand my Community achievements bar.

Auto Fill Duplicate Name/Address Text Through Check Box Selection

Avatar

Former Community Member
I'm trying to create a very straight forward form that has Name and Address information for customers. I want to have the end-user enter a customers Name and "Service Address" and then just check a box (if the Service and Billing Name/Address are identical) to carry over this information to text fields used for Name and "Billing Address".



Would I need to write a script for this or is there other built in functionality in Designer that would allow me to accomplish this?
5 Replies

Avatar

Former Community Member
Use script like this in the change event of your checkbox.



if(this.rawValue == 1)

form1.subform.TextField2.rawValue = form1.subform.TextField1.rawValue ;

else

form1.subform.TextField2.rawValue = "";



Rich Ruiz

Novanis

Avatar

Former Community Member
Does this apply to both LiveCycle Designer as well as the ES version? Also, which language is being used JavaScript or FormCalc?

Avatar

Former Community Member
This is the script in my CheckBox change event.



----- form1.#subform[0].Header.CheckBox1::change: - (JavaScript, client) ---------------------------



if(this.rawValue == 1)

form1.#subform[0].Header.txtOrderedByCompanyName.rawValue = form1.#subform[0].Header.txtDeliverToCompanyName.rawValue ;

else

form1.#subform[0].Header.txtOrderedByCompanyName.rawValue = "";



I'm not getting the txtDeliverToCompanyName to change to the txtOrderedByCompanyName here and I'm not sure what the error is. I do not receive any error code messages when I look at the PDF preview (I'm guessing because it is a JavaScript and not FormCalc) so I can't trace my error.



Any suggestions here?



Also, I would like to have the same function occur from the same check box in 8 other fields as well.



TIA



Paul