Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
03-05-2008, 11:12 AM #1
- Join Date
- Mar 2006
- Thanked 0 Times in 0 Posts
Populate dropdown with another dropdown, dynamically
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, 03:47 PM #2
- Join Date
- Dec 2005
- Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
- Thanked 637 Times in 625 Posts
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.