Re: onchange = "$_SESSION['Alarm'] = getelementbyid('alarmReport').value ;"
| From: | Marek Kilimajer | Date: | Tue, 26 Aug 2003 10:34:04 +0000 |
| Subject: | Re: onchange = "$_SESSION['Alarm'] = getelementbyid('alarmReport').value ;" | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-160743@lists.php.net to get a copy of this message | ||
getelementbyid('AlarmReport').value will not get the value of the selected option. Use
this.options[this.selectedIndex].value
Session var can be set only on the server, you must post the form to get the value or use some javascript to do it, eg:
img = new Image();
img.src="set_session_var.php?varname=" + this.options[this.selectedIndex].value;
Mrunal Wagh wrote:
hi,
I have a SELECT in which I would like to store the variable value in the
Session variable of onchange event of the SELECT. I am stuck up with the
syntax could u please help.
<Select name="AlarmReport" id = "AlarmReport" **I want to do this*****
onchange = "$_SESSION['Alarm'] = getelementbyid('AlarmReport').value >
<option value='1 day'>1 day </option>
<option value='2 days'>2 days </option>
<option value='7 days'>7 days </option>
<option value='1 month'>1 month </option>
<option value='1 year'>1 year </option>
</Select>
Best Regards,
Mrunal