Address Auto-Fill Ckeck Box

Javascript code that automatically fills in the address in all places needed on the page after just once entering it and selecting the check box.

Introduction:

I ran across this code when working on a registration product site. The goal is to save the user’s time by not having them fill in the same address over and over, if the address for there billing is the same as the mailing address.

You can view a working form by clicking here.

Source Code







Mailing Address
City:
State:
Billing Address
( same as above)
City:
State:
Tagged : / / / /

6 thoughts on “Address Auto-Fill Ckeck Box

  1. hi;
    i am facing aproblem when the fills the form by using googles auto fill feature.in my form i have a country drop down and based on that i am showing states.it’s not working when the user comes from autofill is there any solution.plz let me know.
    “jhankar”(j_rayjit@hotmail.com)

  2. The sample source code has a slight error. Copy from the source code of the example page instead and it'll work fine!

    to_el = f['bill' fld_name[i ]]; // on this page

    to_el = f['bill' + fld_name[i++]]; // on working example page

  3. The sample source code has a slight error. Copy from the source code of the example page instead and it'll work fine!

    to_el = f['bill' fld_name[i ]]; // on this page

    to_el = f['bill' + fld_name[i++]]; // on working example page

  4. Also, make sure that ‘bill’ (or whatever you change it to) is the prefix to the names of your 2nd set of boxes.

    to_el = f[‘bill’ fld_name[i ]];

    if first set of boxes are named ‘city’ and ‘state’
    so 2nd set would be called ‘billcity’ and ‘billstate’

    also, make sure you put in your input names in here where ‘city’ and ‘state’ are:

    var fld_name = new Array(‘city’ , ‘state’);

    thanks for the code so i didnt have to write it myself!

  5. I tried the code but when I click on the check box, the fields below do fill with the previous city and address. What am I doing wrong? Thanks

Leave a Reply

Your email address will not be published. Required fields are marked *