adrianconst
Programmer
I have a HTML page with a form in it
<form name="form3" action = "ATest.asp" method="POST">
<table align = center>
<tr>
<td align=center><b>Code</b></td>
</tr>
<tr>
<td align=center><select name="Code" id="Code" onchange="f1(this.form)">
<option>Choose one of the following
<option selected=TRUE>105
<option>106
</select></td>
</tr>
<tr></tr>
<tr><td align=center><b>Description<b></td>
</tr>
<tr>
<td align=center><input name="Descr" id="Descr" size=60></td>
</tr>
</table>
<br>
<input type="submit" value="Send" id=submit1 name=submit1>
</form>
and a implementation in JavaScript for the f1 function as below:
<script language=javascript>
function f1()
{
if (document.form3.Code.selectedIndex != 0) {
nr = document.form3.Code.selectedIndex;
val1 = String(document.form3.Code.value);
window.location.href='AUpdateTPersonal.asp?nr='+nr+'&val='+val1;
}}
</script>
The effect of change button is that the nr parameter is transmited correctly but the val parameter will be empty.
Can anyone know what is wrong here?
<form name="form3" action = "ATest.asp" method="POST">
<table align = center>
<tr>
<td align=center><b>Code</b></td>
</tr>
<tr>
<td align=center><select name="Code" id="Code" onchange="f1(this.form)">
<option>Choose one of the following
<option selected=TRUE>105
<option>106
</select></td>
</tr>
<tr></tr>
<tr><td align=center><b>Description<b></td>
</tr>
<tr>
<td align=center><input name="Descr" id="Descr" size=60></td>
</tr>
</table>
<br>
<input type="submit" value="Send" id=submit1 name=submit1>
</form>
and a implementation in JavaScript for the f1 function as below:
<script language=javascript>
function f1()
{
if (document.form3.Code.selectedIndex != 0) {
nr = document.form3.Code.selectedIndex;
val1 = String(document.form3.Code.value);
window.location.href='AUpdateTPersonal.asp?nr='+nr+'&val='+val1;
}}
</script>
The effect of change button is that the nr parameter is transmited correctly but the val parameter will be empty.
Can anyone know what is wrong here?