Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP or Javascript question?!?

Status
Not open for further replies.

shamrox

Programmer
Sep 27, 2001
81
0
0
US
Ok. Not sure where this belongs, so hopefully someone will assist.

I have 3 dropdown lists on a webpage. All 3 are populated via php to a mysql database.

I'd like to have the 2 drops DISABLED Or even invisible unless a certain item is selected from dropdown #1. How do I do this?

Example. If Item B is selected from drop #1, then Drop #2 would appear and you could make a selection from it.

If Item D was selected from drop #1, then drop #3 would appear and you could make a selection.

End result, all 3 drops would pass their value on Submit.

Enough info? Thanks for the help.

 
If the 2nd and 3rd dropdowns are to be present on the page but inactivated, you're talking client-side scripting.

PHP would only be involved to the extent that the HTML stream it sends to the client would include this client-side code.


Want the best answers? Ask the best questions!

TANSTAAFL!!
 
You could use javascrip to do an on select command, use that data to generate the other lists you want. I guess you could go about this by building a switch for all the case for the 2nd drop down and have different outputs based on different queries depending on what value was submitted before.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top