Linked selects
Posted: Sat Feb 03, 2007 2:33 pm
Hi Guys
How can I create 2 drop boxes (select tags) that are linked using PHP?
ie The options available in the 2nd drop box depends upon the selection in the first box.
Example:
Box1 = Animal Type
Box2 = Breed
If the user selects 'Cat' in Box1 then the options in Box 2 are Persian, Tabby etc.
If the user selected 'Dog' in Box1 then the options in Box2 are Alsatian, Collie etc.
I have produced the PHP code to generate the first select tag but I'm not sure how I can make the 2nd box dependant upon the selection of the first. Is this even possible with PHP or will I need to learn a bit of client side script such as Javascript?
Thanks
Darwood
How can I create 2 drop boxes (select tags) that are linked using PHP?
ie The options available in the 2nd drop box depends upon the selection in the first box.
Example:
Box1 = Animal Type
Box2 = Breed
If the user selects 'Cat' in Box1 then the options in Box 2 are Persian, Tabby etc.
If the user selected 'Dog' in Box1 then the options in Box2 are Alsatian, Collie etc.
I have produced the PHP code to generate the first select tag but I'm not sure how I can make the 2nd box dependant upon the selection of the first. Is this even possible with PHP or will I need to learn a bit of client side script such as Javascript?
Thanks
Darwood