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!

Tying listboxes?

Status
Not open for further replies.

svar

Programmer
Aug 12, 2001
349
0
0
GR
I am trying to do the following:
suppose I have a complex structure:


$products=[vegetables=>[peppers=>[green,red,orange],lettuce=>[long,curly],...]];
In the page the user must pick a single produce (e.g. red peppers) and what I want
is to tie two listboxes so that if peppers is chosen on the first, the three (green, red,orange) options appear on the second. Of course I can join the strings and have a single listbox, but the first choice is obviously more efficient

Is this possible in PHP and if so, how does one tie the options?
 
Hi

What you described are usually referenced as cascading select. That is mostly about JavaScript, so you will find examples in forum216, for example thread216-1525433, thread216-1698060, thread216-1581200. If JavaScript alone is not enough, then it belongs to forum1600.

Regarding your question about PHP, yes can be done with PHP, but if you involve no client-side code then it is reduced to just a couple of separate forms which pass data forward to the next form. If you involve JavaScript, then see the previous paragraph.


Feherke.
feherke.ga
 
Status
Not open for further replies.

Similar threads

Replies
21
Views
48

Part and Inventory Search

Sponsor

Back
Top