Logo - ProgrammingHead

How to make Billing Address Same as Shipping Address

If you want to set the Billing Address Same as Shipping Address, then you are at the Right Place.
Because in this Tutorial we have created an HTML Webpage to answer your Question.
Here using this CODE, we can copy or Fill the Any Input Field the Same as Shipping Address with a single button click.

How to make Billing Address Same as Shipping Address

code from Above Explained in Detail:

use of myFunction()

Using Input box's onClick event, we will call JavaScript functions [onclick="myFunction()"]
Which includes Some Variables and If Else Condition.

use of Variables for Input, Shipping and Billing Inputs

By using this var checkBox we will store our Input box Element [Check Box Input] by using this CODE.

Where document.getElementById("myCheck") will grab the HTML element by the Element ID: myCheck.
We will do the same for grabbing Shipping Address Element and Billing Address.

use of IF ELSE Conditions

By using IF Else condition we will check waters CheckBox is checked or NOT.
For that we are giving here this Condition.

Where checkBox.checked will return TRUE or FALSE on Checking/Unchecking the Input Check Box

Copying Input Values to Billing Address textBil.value=textShip.value

Using this link textBil.value=textShip.value;
We will Put Shipping Address Value (textShip.value) inside Billing Address (textBil.value) Text Field.

use of textBil.value=" ";

And by using this line textBil.value=" ";
We are clearing or Putting Empty String inside our Billing Address Text Feild whenever user uncheck the Input Box.