Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Ship to and Bill to the same


Not applicable
Thanks for all the wonderful tips and tricks here...I've learned a lot. I am trying to create a check box that will automatically transfer the "Ship to" to the "Bill to" if the are the same. I can't seem to figure it out.

Here is an example:

I've used the following code but to no avail:

var ShipToCompany = "";

var ShipToContact = "";

var ShipToAddress = "";

var ShipToCityStateZip = "";

var ShipToPhone = "";

var ShipToEmail = "";

function InitSaveVariables(form1) {

ShipToCompany = form1.ShipToCompany.value;

ShipToContact = form1.ShipToContact.value;

ShipToAddress = form1.ShipToAddress.value;

ShipToCityStateZip = form1.ShipToCityStateZip.value;

ShipToPhone = form1.ShipToPhone.value;

ShipToEmail = form1.ShipToEmail.value;


function infoCopy(form1) {

if (CheckBox1.copy.checked) {


form1.ShipToCompany.value = form1.BillToCompany.value;

form1.ShipToContact.value = form1.BillToContact.value;

form1.ShipToAddress.value = form1.BillToAddress.value;

form1.ShipToCityStateZip.value = form1.BillToCityStateZip.value;

form1.ShipToPhone.value = form1.BillToPhone.value;

form1.ShipToEmail.value = form1.BillToEmail.value;


else {

form1.ShipToCompany.value = ShipToCompany;

form1.ShipToContact.value = ShipToContact;

form1.ShipToAddress.value = ShipToAddress;

form1.ShipToCityStateZip.value = ShipToCityStateZip;

form1.ShipToPhone.value = ShipToPhone;

form1.ShipToEmail.value = ShipToEmail;



Any help would be great appreciated.
0 Replies


Level 10
First, you are using the 'value' property and you should be using the 'rawValue' property. Second, if a user has entered data into the Ship To form fields you don't need to create new variables to store them.

Here is the click event on my checkbox object called 'copy', where the checkbox has an On Value of 1 and an Off Value of 0.

if (this.rawValue == "1") {

form1.subform1.billToCompany.rawValue = form1.subform1.shipToCompany.rawValue;

form1.subform1.billToAddress.rawValue = form1.subform1.shipToAddress.rawValue;

form1.subform1.billToCity.rawValue = form1.subform1.shipToCity.rawValue;




Not applicable
Steve thanks for getting me started and the clarification. Still cannot get the data to move over. I think I'm over looking something.

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

if (this.rawValue == "1") {

form1.subform1.BillToCompany.rawValue = form1.subform1.ShipToCompany.rawValue;

form1.subform1.BillToContact.rawValue = form1.subform1.ShipToContact.rawValue;

form1.subform1.BillToAddress.rawValue = form1.subform1.ShipToAddress.rawValue;

form1.subform1.BillToCityStateZip.rawValue = form1.subform1.ShipToCityStateZip.rawValue;

form1.subform1.BillToPhone.rawValue = form1.subform1.ShipToPhone.rawValue;

form1.subform1.BillToEmail.rawValue = form1.subform1.ShipToEmail.rawValue;



Level 10
If you do not have a subform called subform1 than these fully-qualified object names will not work.

You can either

1. change the subform names in the script to match your subform name

2. reference the fields without the form and subform prefix, or

3. if the subform is untitled use the syntax form1.#subform[0].BillToCompany.rawValue, for example.



Level 10
Hi TF,

A tip from JP Terry's (excellent) book!

When in the script editor you can hover over the field you want to reference. Pressing control will turn the cursor into a down arrow, then holding control and clicking the field will insert the object's reference directly in your script:


If you hold control and shift, you will get a fully qualified reference:


Try it out, as it helps ensure that the references are correct.