Forum Moderators: coopster
What I am wanting to accomplish is to generate a second drop down select menu based upon the option selected in a first select menu.
I know this can be done using $_POST or through data stored in my mySQL database. What I am looking for is a way to generate DROP DOWN 2 on-the-fly when the selection in DROP DOWN 1 is changed (like with the onChange() function available through JavaScript).
Any help or advise would be greatly appreciated. =)
If you had an array loaded with values for your second drop down, then you could populate the second drop down using the value of the first drop down as the key to the array. It should work. But that begs the question of why php for this, since it seems to be a natural for js.
And, Welcome to WebmasterWorld.
Basically, then, write your javascript, possibly even 'dynamically' (i.e., the javascript is can be different depending on the request), and then have PHP echo it out or process it for you.
Also have some other dynamical select menu's generated from DB queries and written with PHP, its not too hard tbh, but for what you want I couldnt begin to draw you an example :)