title: Copy Billing and Shipping Address Fields Copy to Another
body: <p>I am trying to copy shipping address into billing address with one click.
  As you can see here it works for an example that I found from a website :  <a href="http://jsfiddle.net/aDNH7/" rel="nofollow">http://jsfiddle.net/aDNH7/</a></p>
  
  <p>My problem is when I implement code into my form, It doesn't work. I'm doing something wrong in somewhere but I'm not sure.</p>
  
  <p>My code is here . If you can help me to find the problem, i will appriciate that. </p>
  
  <pre><code>&lt;script&gt;
  
      function FillBilling(f) {
  
          if(f.billingtoo.checked == true) {
  
              f.billing_first_name.value = f.first_name.value;
  
              f.billing_last_name.value = f.last_name.value;
  
              f.billing_address_1.value = f.address_1.value;
  
              f.billing_address_2.value = f.address_2.value;
  
              f.billing_city.value = f.city.value;
  
              f.billing_state.value = f.state.value;
  
              f.billing_zipcode.value = f.zipcode.value;
  
  
  
          }
  
          if(f.billingtoo.checked == false) {
  
              f.billing_first_name.value = '';
  
              f.billing_last_name.value = '';
  
              f.billing_address_1.value = '';
  
              f.billing_address_2.value = '';
  
              f.billing_city.value = '';
  
              f.billing_state.value = '';
  
              f.billing_zipcode.value = '';
  
          }
  
      }
  
  &lt;/script&gt;
  
  &lt;form action="http://www......" method="post" accept-charset="utf-8"&gt;&lt;h1&gt;SHIPPING ADDRESS&lt;/h1&gt;
  
  &lt;label for="first_name"&gt;First Name&lt;/label&gt;
  
  &lt;div&gt;&lt;input type="text" name="first_name" id="first_name" value="" /&gt;&lt;/div&gt;
  
  
  
  &lt;label for="last_name"&gt;Last Name&lt;/label&gt;
  
  &lt;div&gt;&lt;input type="text" name="last_name" id="last_name" value="" /&gt;&lt;/div&gt;
  
  
  
  &lt;label for="address_1"&gt;Address 1&lt;/label&gt;
  
  &lt;div&gt;&lt;input type="text" name="address_1" id="address_1" value=""/&gt;&lt;/div&gt;
  
  
  
  &lt;label for="address_2"&gt;Address 2&lt;/label&gt;
  
  &lt;div&gt;&lt;input type="text" name="address_2" id="address_2" value=""/&gt;&lt;/div&gt;
  
  
  
  &lt;label for="city"&gt;City&lt;/label&gt;
  
  &lt;div&gt;&lt;input type="text" name="city" id="city" disabled="disabled" value="Los Angeles" /&gt;&lt;/div&gt;
  
  
  
  &lt;label for="state"&gt;State&lt;/label&gt;
  
  &lt;div&gt;&lt;input type="text" name="state" id="state" disabled="disabled" value="CA" /&gt;&lt;/div&gt;
  
  
  
  &lt;label for="zipcode"&gt;Zip Code&lt;/label&gt;
  
  &lt;div&gt;&lt;input type="text" name="zipcode" id="zipcode" disabled="disabled" value="90064" /&gt;&lt;/div&gt;
  
  
  
  &lt;label for="phone"&gt;Phone&lt;/label&gt;
  
  &lt;div&gt;&lt;input type="text" name="phone" id="phone" value="" /&gt;&lt;/div&gt;
  
  
  
  &lt;input type="checkbox" onclick="FillBilling(this.form)" name="billingtoo"&gt;
  
  &lt;em&gt;Check this box if Billing Address and Mailing Address are the same.&lt;/em&gt;
  
  
  
  &lt;h1&gt;BILLING ADDRESS&lt;/h1&gt;
  
  
  
  &lt;label for="billng_first_name"&gt;First Name&lt;/label&gt;
  
  &lt;div&gt;&lt;input type="text" name="billng_first_name" id="billng_first_name" value="" /&gt;&lt;/div&gt;
  
  
  
  &lt;label for="billng_last_name"&gt;Last Name&lt;/label&gt;
  
  &lt;div&gt;&lt;input type="text" name="billng_last_name" id="billng_last_name" value="" /&gt;&lt;/div&gt;
  
  
  
  &lt;label for="billing_address_1"&gt;Address 1&lt;/label&gt;
  
  &lt;div&gt;&lt;input type="text" name="billing_address_1" id="billing_address_1" value=""/&gt;&lt;/div&gt;
  
  
  
  &lt;label for="billing_address_2"&gt;Address 2&lt;/label&gt;
  
  &lt;div&gt;&lt;input type="text" name="billing_address_2" id="billing_address_2" value=""/&gt;&lt;/div&gt;
  
  
  
  &lt;label for="billing_city"&gt;City&lt;/label&gt;
  
  &lt;div&gt;&lt;input type="text" name="billing_city" id="billing_city"  value="" /&gt;&lt;/div&gt;
  
  
  
  &lt;label for="billing_state"&gt;State&lt;/label&gt;
  
  &lt;div&gt;&lt;input type="text" name="billing_state" id="billing_state" value="" /&gt;&lt;/div&gt;
  
  
  
  &lt;label for="billing_zipcode"&gt;Zip Code&lt;/label&gt;
  
  &lt;div&gt;&lt;input type="text" name="billing_zipcode" id="billing_zipcode" value="" /&gt;&lt;/div&gt;
  
  
  
  &lt;div&gt;&lt;input type="submit" value="Send" /&gt;&lt;/div&gt;
  
  
  
  &lt;/form&gt;
  </code></pre>