P
paulmitchell507
I am not sure if this should be posted in a Java newsgroup or not, I
am sure I will be told where it should be! I have a small
asp(classic) app that runs the following java script to display a drop
down list containing usernames from a access 2k database.
<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
This works, to the point where it puts the value of staff_ID into
request.form("courses"). What I would like to do is store the
"Group_ID" values also. Please could somebody provide the code to
store the additional value. I then post the 2 values to a another asp
page for insertion into another table in the database.
Regards.
am sure I will be told where it should be! I have a small
asp(classic) app that runs the following java script to display a drop
down list containing usernames from a access 2k database.
<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
This works, to the point where it puts the value of staff_ID into
request.form("courses"). What I would like to do is store the
"Group_ID" values also. Please could somebody provide the code to
store the additional value. I then post the 2 values to a another asp
page for insertion into another table in the database.
Regards.