P
paulmitchell507
I am not sure if this should be posted in a Java forum, bit it does
concern asp.
I have the following script on my asp (classic) page.
<html>
<head>
<title>Example combo box</title>
<script language="javascript">
<!--
function dept_onchange(frmSelect) {
frmSelect.submit();
}
//-->
</script>
</head>
<body>
<form name="frmSelect" method="Post" action="select.asp">
<SELECT name=courses LANGUAGE=javascript onchange="return
dept_onchange(frmSelect)">
<%
Set oRs=Server.CreateObject("adodb.recordset")
strSQL = "SELECT Status_ID, Staff_ID, firstlastName FROM staff WHERE
Status_ID=1 Or Status_ID=19 ORDER by firstlastname"
oRs.Open strSQL, conn
Do while not oRs.EOF
if Request.Form("courses") = oRs("firstlastName") then 'if this is
the selected one then display as selected
Response.Write "<OPTION VALUE = '" & oRS ("staff_ID") & "'
SELECTED>"
Response.Write oRs("firstlastName") & "</Option>"
oRs.MoveNext
else
Response.Write "<OPTION VALUE = '" & oRs ("Staff_ID") & "'>"
Response.Write oRs("firstlastName") & "</Option>"
oRs.MoveNext
end if
loop
The script works fine, it lists the firstlastname field from the
access 2k database and places the corrasponding staff_ID value in
Request.Form("courses"). What I would like to do is display the
selected firstlastname value in box further down the page.
I would appreciate it if anybody could help with, what looks like, a
simple task.
concern asp.
I have the following script on my asp (classic) page.
<html>
<head>
<title>Example combo box</title>
<script language="javascript">
<!--
function dept_onchange(frmSelect) {
frmSelect.submit();
}
//-->
</script>
</head>
<body>
<form name="frmSelect" method="Post" action="select.asp">
<SELECT name=courses LANGUAGE=javascript onchange="return
dept_onchange(frmSelect)">
<%
Set oRs=Server.CreateObject("adodb.recordset")
strSQL = "SELECT Status_ID, Staff_ID, firstlastName FROM staff WHERE
Status_ID=1 Or Status_ID=19 ORDER by firstlastname"
oRs.Open strSQL, conn
Do while not oRs.EOF
if Request.Form("courses") = oRs("firstlastName") then 'if this is
the selected one then display as selected
Response.Write "<OPTION VALUE = '" & oRS ("staff_ID") & "'
SELECTED>"
Response.Write oRs("firstlastName") & "</Option>"
oRs.MoveNext
else
Response.Write "<OPTION VALUE = '" & oRs ("Staff_ID") & "'>"
Response.Write oRs("firstlastName") & "</Option>"
oRs.MoveNext
end if
loop
The script works fine, it lists the firstlastname field from the
access 2k database and places the corrasponding staff_ID value in
Request.Form("courses"). What I would like to do is display the
selected firstlastname value in box further down the page.
I would appreciate it if anybody could help with, what looks like, a
simple task.