drop down boxes?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
cooper3000
Forum Newbie
Posts: 8
Joined: Wed Jan 18, 2006 5:16 am
Location: London

drop down boxes?

Post by cooper3000 »

does anyone know how to create a form that allows the user to firstly pick from a drop down list that automatically gives options in a second dropdown box.

eg.

'category1'
is selected from dropdown box 1,
this then populates dropdown box 2 with the options
'category1.a' or 'category1.b'

or if
'category2'
is selected from dropdown box 1
then dropdown box 2 gives the options of
'category2.a' or 'category1.b'

i f any one knows how I should code this please help, if not point me in the direction of a tutorial that can.

Cheers

Cooper
matthijs
DevNet Master
Posts: 3360
Joined: Thu Oct 06, 2005 3:57 pm

Post by matthijs »

Some links that might be useful:
A tutorial on devshed in which a searchable inventory system is build. It uses the functionality you describe. You might have to filter out the code you need, but since it's all well documented, that should not be a problem
http://www.devshed.com/c/a/PHP/Creating ... h-Results/
Further, Bobby van der Sluis provides an excellent write up of unobtrusive dynamic select boxes.
http://www.bobbyvandersluis.com/article ... select.php
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Look up CoderGoblin's tutorial on this site as well: viewtopic.php?t=29084
Post Reply