> 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


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to