Page 1 of 1

Dynamic dropdown without changing context

Posted: Fri Feb 22, 2008 11:35 am
by PhpDog
I have two html dropdown controls on an php intranet project. How can I get the second one to change when the user makes a new selection from the first one without changing the current screen context please?

For example, the first select list is, say,

short box
long box
big box
small box

and the second select list for the first item (short box - the default) is

red
blue
green

but by selecting 'long box' from the first select list the second select list is now

black
purple
yellow
orange

without the rest of the screen changing.

Re: Dynamic dropdown without changing context

Posted: Fri Feb 22, 2008 11:38 am
by RobertGonzalez
This would be done client side, with Javascript. I am drawing a complete blank on the name of the process you are asking about, but essentially you are using the selected index of one form element to control the content of another form element.

Re: Dynamic dropdown without changing context

Posted: Tue Feb 26, 2008 11:57 pm
by devendra-m
refer http://www.hotandco.com

when you select netherlands in country field , city field will be loaded with cities in netherlands. You need ajax for that.

Re: Dynamic dropdown without changing context

Posted: Wed Feb 27, 2008 3:28 am
by PhpDog
Many thanks fo the replies.

I have solved the problem by using dynamic php to create Javascript menus on the fly from the SQL Server 2005 database.
Works nicely. :)