Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Dec 2009
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    JavaScript Drop Down List HELP!

    Hi All,

    I am really stumped. I am not sure why it's not working.

    Basically, selecting a country will pre-populate the state field for both billing and shipping sections. Please help!

    Also, when copying the billing info from shipping, the state field doesn't seem to copy over.

    I have attached the entire code as a text file (part1 + part2 = complete code).

    Thanks!

    Attached Files Attached Files

  • #2
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,579
    Thanks
    23
    Thanked 643 Times in 642 Posts
    In function changeShippingStates()

    Make these types of changes:
    Code:
    document.myform.Shipping_State.options[document.myform.Shipping_State.options.length] = new Option('Alabama','AB');
    document.myform.Shipping_State.options[document.myform.Shipping_State.options.length] = new Option('Alaska','AK');
    document.myform.Shipping_State.options[document.myform.Shipping_State.options.length] = new Option('Arizona','AZ');
    document.myform.Shipping_State.options[document.myform.Shipping_State.options.length] = new Option('Arkansas','AR');
    document.myform.Shipping_State.options[document.myform.Shipping_State.options.length] = new Option('California','CA');
    document.myform.Shipping_State.options[document.myform.Shipping_State.options.length] = new Option('Colorado','CO');


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •