Otteneder Hermann wrote: > hi everybody, > > i have a short problem: > i have two drop down menues in a form. the content of the second dropdown is > dependent from the selection in the first dropdown menue. now i want write a > short javascript which runs on the onSelect - event of the first dropdown. > this script gives me the selected entry of the first dropdown menue. now i > have to give this value somehow into the PHP-environment for a DB-Query. > The feched data i want dynamically fill into the second dropdown. But how do > I get the value from the javascript variable into the php environment > without an submit of the form?? has enybody a solution for this? > > thanx so far - hermann...
Ottneder, You can't easily do what you want i.e. to have an html page in the user's browser with Javascript which goes back to a php script on the server after a user select in order to pick up the data for a new select list. Normally when creating dynamic select lists, I actually get the php to drop ALL the data in the top of the page as Javascript variables. You can see an example in the source of http://tandridge.cpfc.co.uk/tables. I guess it is at least theoretically possible to do what you want by getting your Javascript to open up a "hidden" background frame targetted at a php script which then puts the data back into that frame so you can then access it in the original frame. It would be a bit complicated and clumsy... The third option is to have your select as a separate frame and do a submit of just that part of the page. This is the easiest to code but probably the most clumsy from a graphics point of view. How much data is involved? How many different versions of the select list and how many options in each version? If it's not too much, then I'd put it all in the page as I do, as compactly as you can e.g. short variable names etc. Hope this helps, George -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php