Some PHP help regarding drop down menus...

BoyBlunder

[H]ard|Gawd
Joined
Nov 10, 2003
Messages
1,245
I need some help regarding a drop down menu. I don't really know how to explain it, so I'll show you an example here .

It's basically some drop down menus that change depending on what the user selects for the one before it.

I would love someone forever if they could steer me in the right direction.

BB.
 
The term you're looking for is a chained select. That search will get you plenty of information.

What you wan't to do doesn't necessarily have anything to do with PHP. At least not as I would implement it. Check out XMLHttpRequest. Basically what I would do is this:
  1. Attach an onchange listener to the select box.
  2. Have that listener call a function that uses XMLHttpRequest to submit a query back to your server with the value selected in the first box. (Here's where you'd want PHP or some other server-side scripting to process the request.)
  3. The page that gets the request returns XML data that can be used to fill out the second select box, using the DOM.

The details aren't totally trivial, but it's not too hard, and people here can certainly help more.
 
I believe that is easier to do with Javascript.
But I would suggest to google for "dynamic drop down menu"
 
Back
Top