Re: question (as if anything else would be in an email to the list...)

From: Date: Thu, 18 Jan 2001 22:00:17 +0000
Subject: Re: question (as if anything else would be in an email to the list...)
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-35460@lists.php.net to get a copy of this message
> then again, in the context of what you're doing, why not just build in a > little php logic that knows if your select is a certain value, something > else should happen? Well, the select can't be a value until the user choses something (the <option> stuff). Based on the option the choose, a value needs to be written to the <select> variable (in this case, it's an id value that is used later to put the choice in a database field. It's a venue location selector for various shows, and the id of the venue gets put in the record of the show). So, I *am* trying to build a little php logic. Kinda. But it's not working. As for the suggestion to do the javascript, would this code work (assuming that all the variables had values except the ones being written to)... <script> <!-- function changeValue(newValue) { document.formname.inputNameToChange.value = newValue; } //--> </script> <form name=formname> <input type=hidden name=inputNameToChange> <select name="location"onChange="changeValue(this.options[this.selectedIndex].value) ;"> <option value= <? $value1 ?>>label1 <option value=<? $value2 ?>>label2 </select> </form> and then me be able to use $location in a query? I didn't think it could work this way... -j

« previous php.general (#35460) next »