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 to the CF scene
    Join Date
    Jun 2014
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Arrow Populating and Hiding/Showing States Drop down based on Country selected value

    Hi,

    I have a working code for populating States drop down list with an array based on Country drop down list selected value and I would like to add something like Jquery show() and hide() to hide the states drop down if the country is not included in the array of "countryStateArray" and do the opposite while populating the states list
    here is my code on Fiddle
    Edit fiddle - JSFiddle

    Thank you

  • #2
    Senior Coder
    Join Date
    Mar 2005
    Location
    Portsmouth UK
    Posts
    4,505
    Thanks
    3
    Thanked 501 Times in 488 Posts
    these lines in the code all ready hide/show the second select if a states list exists or not

    Code:
            if (stateList.length < 2) stateObj.style.display = 'none';
        else stateObj.style.display = 'inline';
    Vic

    God Loves You and will never love you less.

    http://www.vicsjavascripts.org/Home.htm

    If my post has been useful please donate to http://www.operationsmile.org.uk/


  •  

    Tags for this Thread

    Posting Permissions

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