Page 1 of 1

drop down and forms

Posted: Mon Aug 21, 2006 2:36 pm
by apalm
Hi

I would like to know how to build a drop down menu in one PHP page based on the answer of previous drop down menu.

example.

first drop down contained :

Manhattan/Queens/Staten Island/Bronx

Depending on what location, different cities will show.

if Manhattan -> UES (upper east side), UWS, Downtown, etc


Anna

Re: drop down and forms

Posted: Mon Aug 21, 2006 2:40 pm
by Luke
apalm wrote:I would like to know how to build a drop down menu in one PHP page based on the answer of previous drop down menu.
when you say drop-down menu, are you talking about a select tag?

Code: Select all

<select name="selectbox"><option value="bla"></option></select>
Also, do you plan on this information refreshing without a page reload?

Posted: Mon Aug 21, 2006 2:46 pm
by feyd
CoderGoblin has a tutorial posted that talks of doing this (using stored arrays in Javascript) which may be of interest.

viewtopic.php?t=29084

drop down and forms

Posted: Tue Aug 22, 2006 9:08 am
by apalm
Yes, I am talking about the select tag. If I understood correctly the is no way of doing it in PHP without javascript help correct???

The example seem to be a little bit more that what I need.

Maybe this will clear a little bit more.

I need a php page that will show two drop down menus. The first with cities and the second with specialty. Once the specialty is selected a third drop down menu will show with a variaty for the specialty.

example: 2 drop down will have medical/dentist/labs/etc

If the user wants medical, the third menu will contain Cardio/Anesthesiology/Ophthalmology/etc

and so on.

How can I do that??


Thank you for your help.

Anna

Posted: Tue Aug 22, 2006 9:20 am
by Ollie Saunders
Yes, I am talking about the select tag. If I understood correctly the is no way of doing it in PHP without javascript help correct???
Correct but you can do it with only very little JS.
Maybe this will clear a little bit more.
I think we understand what you want to achieve. I also understand that you probably want to use the method with least JS. In which case see method one in my post on this thread.

Posted: Tue Aug 22, 2006 9:39 am
by apalm
Thank you.

:)

Anna