droddis Posted February 13, 2008 Share Posted February 13, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/90801-dynamic-drop-down-menu/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.