www.webdeveloper.com
Results 1 to 2 of 2

Thread: Multiple Drop-Down Menus

  1. #1
    Join Date
    Jan 2013
    Posts
    4

    Multiple Drop-Down Menus

    I imagine there is a name for what I am trying to accomplish, but I don't know of it, so I apologize if I confuse anyone with what i'm looking to do:

    I have a particular MySQL table that lists from a large table of businesses. Inside of the table with the businesses, I have a city field.

    It is to the point that performance is becoming an issue within a HTML form. Can I modify my forms to have a city drop down menu, then once a user selects a city, a list of businesses that matches that city will show up in a second drop down for the user to choose? I imagine jQuery might do the trick, but if there is another way, or if anyone has a jQuery example, I would appreciate it!

  2. #2
    Join Date
    Jul 2013
    Location
    Voorheesville NY USA
    Posts
    541
    Sounds like a perfect application for php and ajax. When your send the page to the client the city <select> is populated. When a selection is made the onchange event of the select tag will call a JS function that will take the value selected, make the ajax call to a php script that grabs the businesses you want and returns the data back to the calling JS which then populates the contents of the 2nd select tag for businesses.

    Need some simple JS skills to grab the initial city value, some more to execute the ajax call (google!) and a little bit at the end to populate the business drop-down and make it visible.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles