Page 1 of 1
communicating with the database
Posted: Thu Nov 06, 2003 5:40 am
by amithn12
i have 2 combo boxes in html,the first contains the field called categories and the second sub categories. When i select any category from categories i must get the particular subcategories in the subcategory combo box.I have a table for category and a different table for subcategory but i have category id in the sub category.
Posted: Thu Nov 06, 2003 6:28 am
by Weirdan
You need something like this:
populate categories dropdown from categories table and subcategories dropdown with the subcategories corresponding to default category. Then in onChange event attached to categories dropdown you need to post the form, so it reloads and populates the subcategories dropdown with the subcategories corresponding to selected categories.
Now you have an idea and can start coding.
Posted: Thu Nov 06, 2003 10:01 am
by JAM
Moving this to Client Side, as Weirdans suggestion is the prefered one (using Javascript) comparing to the php only-way. (Submitting the form each time for the sub-categories to change).
Posted: Sun Nov 30, 2003 9:11 pm
by valen53
anyone else can show me about the 2 combo box tutorial ?
i mean use java script onChange(), then select from DB and show value in second combo box.
anyone can show this kind of tutorial ?
Thanks a lot...