RE: [PHP] question (as if anything else would be in an email to the list...)
| From: | DanO | Date: | Thu, 18 Jan 2001 21:52:13 +0000 |
| Subject: | RE: [PHP] question (as if anything else would be in an email to the list...) | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-35458@lists.php.net to get a copy of this message | ||
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:jason@factory7.com]
Sent: Thursday, January 18, 2001 1:33 PM
To: php-general@lists.php.net
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: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net