just write a js function like:

--cut here--

<script>
<!--
function changeValue(newValue) {
document.formname.inputNameToChange.value = newValue;

//here is alert to show you the thingy
alert(document.formname.inputNameToChange.value);
}
//-->
</script>

<form name=formname>
<input type=hidden name=inputNameToChange>
<select onChange="changeValue(this.options[this.selectedIndex].value);">
<option value=value1>label1
<option value=value2>label2
</select>
</form>

--end cutting--

DanO (javascript is your friend, not your enemy!)


-----Original Message-----
From: Jason Jacobs [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 18, 2001 1:33 PM
To: [EMAIL PROTECTED]
Subject: [PHP] question (as if anything else would be in an email to the
list...)


Hi again.  I have a new problem.  I have a form with a drop down list.  When
the user chooses something from the list, I need a variable to change values
so it can be used upon submission of the form.  I thought maybe I could
throw a little line of code into an onChange() function in the <select  >
tag, but I got the MS Debugger thrown up on me.  Anyone got an idea of how
to do this?  Is it possible to call a javascript function and change the
variable in there?  Or an easier way (like inline php code...)?  Thanks

Jason


--
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]


-- 
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