PHP Classes

How to create two related dropdown list boxes: Link a second dropdown list box with the first one

Recommend this page to a friend!
  All requests RSS feed  >  How to create two related dropdown li...  >  Request new recommendation  >  A request is featured when there is no good recommended package on the site when it is posted. Featured requests  >  No recommendations No recommendations  

How to create two related dropdown list boxes

Edit

Picture of Prama Pakwan by Prama Pakwan - 9 years ago (2015-04-16)

Link a second dropdown list box with the first one

This request is clear and relevant.
This request is not clear or is not relevant.

+3

There are two dropdown list boxes in my form.

I need to show options in the second dropdown automatically based on the selected option of first dropdown list box.

Ask clarification

1 Recommendation

Cascade Select: Generate two dependent HTML form select inputs

This class is meant to generate two HTML form select type inputs making the currently selected value on the first input determine the option values that are made available on the second.

It uses JavaScript to update the second input options when the first input changes.

The class comes with an example that defines the options for both input from data defined by arrays, and also an example that retrieves the options values from MySQL database query results.
This recommendation solves the problem.
This recommendation does not solve the problem.

+2

Picture of Dave Smith by Dave Smith Reputation 7620 - 9 years ago (2015-04-19) Comment

What you are looking to accomplish is called cascading selects. Here is one class that can show you how to do it.


Recommend package
: 
: