Page 1 of 1

dropdown list

Posted: 2016-04-08 00:52
by tuxor
hi I have these tables:
Category1:
-id
-name
-description
example:
1-wood-articles of wood
2-metal-articles of metal
3-textile-articles of textile

Category2:
-id
-id_category1
-name
example
1-1-chairs
2-1-tables
3-2-doors
4-2-windows
5-3-shirts
6-3-pants
7-3-dresses

Now, I have another table Products:
-id
-name
-category1 (dropdown)
-caegory2 (dropdown)

So, when insert a new register in Products, I write the name, choose the category1 in a dropdown and, appears only, the items of the category2 where the id_category1= category1.dropdown(selecteditem). for example, If I choose in category1: textile, appears in the category2 dropdown only these: shirts, pants, dresses.

Another example, if I choose in category1 dropdown wood, show in the category2 dropdown only: chairs, tables.

How can I do that?

Thanks