ChrisQuick
Programmer
I have trouble trying to read the value from a select box, and placing the value into a hidden input.
The code I have is a mix of ASP and javaScript.
Here is what creates the select.
<td>
<select name="txtUser" class="select">
<% CustListArray = Session("CustomerNames"
If IsArray(CustListArray) Then
For counter = 0 to UBound(CustListArray,2)
Response.Write("<option value='" & CustListArray(0,counter) & "'>" & CustListArray(0,counter) & "</option>" & Chr(10))
Next
End If
%>
</select>
<input type="hidden" name="txtUser_hidden">
</td>
and here is the javaScript that trys to set the value from the select to another input on submittal of the form:
frm.txtUser_hidden.value=frm.txtUser.selectedIndex.value;
When the form is submitted, and the value of txtUser_hidden
is read with:
strCustomerName = CheckSQL(Request.Form("txtUser_hidden")
Response.Write(strCustomerName)
The value comes back as UNDEFINED.
Any thoughts?
The code I have is a mix of ASP and javaScript.
Here is what creates the select.
<td>
<select name="txtUser" class="select">
<% CustListArray = Session("CustomerNames"
If IsArray(CustListArray) Then
For counter = 0 to UBound(CustListArray,2)
Response.Write("<option value='" & CustListArray(0,counter) & "'>" & CustListArray(0,counter) & "</option>" & Chr(10))
Next
End If
%>
</select>
<input type="hidden" name="txtUser_hidden">
</td>
and here is the javaScript that trys to set the value from the select to another input on submittal of the form:
frm.txtUser_hidden.value=frm.txtUser.selectedIndex.value;
When the form is submitted, and the value of txtUser_hidden
is read with:
strCustomerName = CheckSQL(Request.Form("txtUser_hidden")
Response.Write(strCustomerName)
The value comes back as UNDEFINED.
Any thoughts?