R
Robert Carlson
I am trying to extract the value from a selected item in a
Select/Option, parse it server side using asp and then populate a text
box on the same page with the value that was parsed. simple example
below:
Two problems I have here:
1. The code: this.frmEditUser.Submit; does not appear to submit the
form.
2. If I submit the form using the Submit button, it works except I
get:
"ROBERT" instead of "ROBERT CARLSON - 7788"
<%
Dim sUserId
sUserId = Request.Form("cmbName")
''' Parse: "7788" from "ROBERT CARLSON - 7788"
%>
<html>
<head>
<title>Test Page</title>
</head>
<script language="javaScript">
function GetUserId()
{
alert("GetUserId called");
this.frmEditUser.Submit;
}
</script>
// This page is duly named: "droplistevent.asp"
<BODY>
<form name=frmEditUser action="droplistevent.asp" method="post">
<select size="1" name="cmbName" tabindex="7"
OnChange="GetUserId()">
<option selected>Choose A Name</option>
<option value=ROBERT CARLSON - 7788 > ROBERT CARLSON - 7788
</option>
</select>
<input type="text" name="txtNewId" size="14" tabindex="2"
value=<%=sUserId%>>
<input type="submit" value="Get User Id" name="cmdGetId"
tabindex="8">
</from>
</body>
</html>
Thanks for any support;
Robert
Select/Option, parse it server side using asp and then populate a text
box on the same page with the value that was parsed. simple example
below:
Two problems I have here:
1. The code: this.frmEditUser.Submit; does not appear to submit the
form.
2. If I submit the form using the Submit button, it works except I
get:
"ROBERT" instead of "ROBERT CARLSON - 7788"
<%
Dim sUserId
sUserId = Request.Form("cmbName")
''' Parse: "7788" from "ROBERT CARLSON - 7788"
%>
<html>
<head>
<title>Test Page</title>
</head>
<script language="javaScript">
function GetUserId()
{
alert("GetUserId called");
this.frmEditUser.Submit;
}
</script>
// This page is duly named: "droplistevent.asp"
<BODY>
<form name=frmEditUser action="droplistevent.asp" method="post">
<select size="1" name="cmbName" tabindex="7"
OnChange="GetUserId()">
<option selected>Choose A Name</option>
<option value=ROBERT CARLSON - 7788 > ROBERT CARLSON - 7788
</option>
</select>
<input type="text" name="txtNewId" size="14" tabindex="2"
value=<%=sUserId%>>
<input type="submit" value="Get User Id" name="cmdGetId"
tabindex="8">
</from>
</body>
</html>
Thanks for any support;
Robert