jbrill Posted July 9, 2007 Share Posted July 9, 2007 hey guys, im trying to create two dropdowns, i need the first one to be the category and the second one to be the subcategory. The category drop down autopopulates with the correct info from the database. and uses the table "category", the value of each drop down is represented by the "cat" field in the table (cat is basically and integer id number) and "Category" is used as what the user actually sees in the drop down (category is the actual word of the category). Once the category is selected i would like to have the sub category auto populate with everything that has the same values as the selected category (cat) Here is a break down of how the tables work. Table 1 Name: "category" Fields for Table 1: "cat" (the id number), "category" ( the actual name of the category) Table 2 Name: "subcategory" Fields for Table 2: "cat" (corresponds with the cat id from table 1 to pull the correct data), "subc" (the basic id of the subcategory), "subcat" the actual name of the subcategory. so the way i see it, have a normal drop down populated by a php query. then on change, populate subcategory drop down where cat = cat and display sub category. i just need to put it into code. can someone please help me. Quote Link to comment Share on other sites More sharing options...
sayedsohail Posted July 11, 2007 Share Posted July 11, 2007 this is a great design, shows us the code your tried so far. Quote Link to comment 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.