SharkBait Posted February 21, 2006 Share Posted February 21, 2006 Hi, I've been looking around and I can not seem to find a simple enough example of what I want to do with javascript and drop down menus.With my first <select> I generate the menu from a PHP array (string and string)depending on what item the user clicks on I want it to populate a corrisponding <select> with another array that is set using PHPI could probally do this with $_GET after selecting the first option, but I would rather have it load the 2nd <select> without reloading the page. There are other form elements that I dont want the user to have to re-enter :)Why does this seems harder than I thought it would?Would I use the OnChange option for the <select> then pass the value of the selectedindex? I am thing unsure how would I go about having javascrip update the 2nd <select> by populating it with one of the indexes from a multidimention array based on the first <select>Hopefully that makes sense. Quote Link to comment https://forums.phpfreaks.com/topic/3512-dropdown-menu-changes-options-in-another/ Share on other sites More sharing options...
SharkBait Posted February 21, 2006 Author Share Posted February 21, 2006 But... Since PHP is serverside, it cant tell what varible is selected in the javascript. I saw an suggestion to use the DOM and have javascript request something from the server, but thats too much work for what I am trying to do...:) Quote Link to comment https://forums.phpfreaks.com/topic/3512-dropdown-menu-changes-options-in-another/#findComment-12085 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.