View Full Version : Populate dropdown with another dropdown, dynamically
03-05-2008, 12:12 PM
I have 2 drop down menu's and only want options in the second one, once the user has selected their options from the first one. For the second list I also want the data to be pulled from a table in my database... Each row has a column called FirstName and a column called Reference. Reference is either Blue, Red, Green, Pink. If they select Pink then I want all the FirstName's that have Pink in their Reference column to populate into the second dropdown... Anyone know of a simple way to do this? I have seen some very complex examples...
03-05-2008, 04:47 PM
Three options the way I see it--
If you want to use Ajax that will also be a smooth ride for your user.
The least smooth would be to submit the form every time an option is selected in the first selectbox, taking control back over to PHP to gather the data for the second selectbox and re-create the HTML page, now with the options in the second selectbox.
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.