Results 1 to 4 of 4

Thread: dependent dropdown boxes in form

Hybrid View

  1. #1

    dependent dropdown boxes in form

    I'm hoping someone can point me in the right direction - I've been searching for ages with no success and haven't really much idea where to look:

    I have a form with two drop-down boxes, where the content of the second needs to be dependent on the option chosen in the first

    eg if the first dropdown box is 'countries' and the second is 'states', and the user chooses USA in the first dropdown box, they should only see USA states in the second box.

    There isn't a high number of choices available to the user so the detail can be in a database or in the file itself with no problem.

    All pointers where I start are very welcome


  2. #2
    Just doing a quick Google I found an example using javascript that looks scalable for your purposes.

    Felgall Javascript - Dynamic Dropdown Boxes

  3. #3
    Aaah, I was seraching for ages, don't know how you found that so quickly.
    Looks good - I'll give it a go.

    php would be even better because it could return options for the second box only when the query has results (in this case, when holiday rentals of a certain size actually exist for the country / states chosen) but this looks like a good 'second best'.


    edit: actually I can use PHP queries within the javascript code to achieve that, so should work fine

  4. #4
    lol, I searched for "javascript dependent drop down form"

Similar Threads

  1. Dropdown Menus in WordPress
    By vectro in forum Blogging
    Replies: 6
    Last Post: 18 May, 2011, 02:57 AM
  2. How Many Low End VPS boxes do you have?
    By Coastercraze in forum Web Hosting
    Replies: 0
    Last Post: 7 December, 2010, 03:54 AM
  3. Help with dropdown menu code
    By tmongy in forum Web Design
    Replies: 9
    Last Post: 13 May, 2010, 16:34 PM
  4. Shipping boxes...
    By moonpeach in forum Business
    Replies: 5
    Last Post: 15 August, 2009, 23:05 PM
  5. Ads in designed boxes?
    By mixke in forum AdSense
    Replies: 7
    Last Post: 8 March, 2009, 01:30 AM

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