SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast akstar's Avatar
    Join Date
    Feb 2009
    Posts
    75
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    After select "United States" from the Drop down box 1 => Drop down box 2 shows states

    Hi guys,

    I have a drop down box that allows the user to select the countries.

    Code HTML4Strict:
    <select size="1" name="D21">
     
    <option>	Afghanistan	</option>
    <option>	Aland Islands	</option>
    <option>	Albania	</option>
    <option>	Algeria	</option>
    <option>	American Samoa	</option>
    .
    .
    .
    and etc....
     
    		  </select>


    How do I create a drop down box number 2, where If the user selects United States in drop down box 1, it will display all the states (e.g NY, LA...) for the user to select in drop down box 2

    Is there any scripts online that does this ?
    Thanks for the advice provided

  2. #2
    SitePoint Evangelist achintya's Avatar
    Join Date
    Apr 2005
    Location
    Chandannagar(India)
    Posts
    459
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Do you have state list stored anywhere?

  3. #3
    SitePoint Wizard silver trophybronze trophy Cups's Avatar
    Join Date
    Oct 2006
    Location
    France, deep rural.
    Posts
    6,869
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    'chained listboxes' is one of the terms I have come across to describe this, its usually a JS job, though as I expect you don't have a corresponging list of states in Afghanistan, you may just want to hide us states unless the user picks 'usa'.

  4. #4
    SitePoint Enthusiast akstar's Avatar
    Join Date
    Feb 2009
    Posts
    75
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Cups View Post
    'chained listboxes' is one of the terms I have come across to describe this, its usually a JS job, though as I expect you don't have a corresponging list of states in Afghanistan, you may just want to hide us states unless the user picks 'usa'.
    yeah, I have no state list

    alrite, will do that. thanks for the tips.

  5. #5
    SitePoint Enthusiast akstar's Avatar
    Join Date
    Feb 2009
    Posts
    75
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    did a little search , and found the answer here - http://www.sitepoint.com/forums/showthread.php?t=208541


Bookmarks

Posting Permissions

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