Jump to content

Dynamic Drop Down Menu


droddis

Recommended Posts

I am trying to create a dynamic drop down menu which does not refresh the page but all the data will becoming from a mySQL db called tbl_locations. I understand php is server side, and it will require another language like JS or AJAX.

 

tbl locations is made up of 3 categories (id, parentid, location)

 

The first drop menu will be hard coded and will get the data using:

"SELECT id, location FROM tbl_locations where parent_id='0'";

 

I need a code which will then create a new drop down menu where the options will be selected from the new id, with out refreshing the page, if that makes sense.

 

So if EUROPE value="3" is selected

 

- a new drop menu will be created

- and the options will taken using "SELECT id, location FROM tbl_locations where parent_id='3";

- if no results are found then no new drop menu is required and the last selected id needs to be submitted by the form.

 

There is no fixed number of drop down menus it will be completely dependant of what is in the database as different locations have more or less sub categorys.

 

I dont know if this makes any sense but i've i've tried my best to explain, and example can be found on http://www.villarenters.com.

 

Can anyone help, it's giving me a BIG HEADACHE.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.