|
Hi,
I have the following code to access an SQL table and 'dynamically' populate a listbox.
What I would like to do is add an onchnage event where the selected value is placed in a Textfield on the same page.
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Drop Down Test</title>
</head>
<body>
<%
dim directorate
directorate = session("Directorate")
dim strSQL
set Conn=Server.CreateObject("ADODB.Connection")
DSN="Driver={SQL Server};Server=BROINFO;Database=ref_datadb;UID=sa; PWD=inforep"
Conn.Open(DSN)
strSQL = "SELECT Main_specialty_description as 'spec_code' FROM main_specialty_look_up where rtrim(directorate) = '" & directorate & "' order by main_specialty_description"
set RS = Conn.execute(strSQL)
Response.Write "<select name=spec_code ><option value='''' selected>Please Select</option>"
Do While Not RS.EOF
Response.Write "<option value=''" & RS("spec_code") &"''>"& RS("spec_code") &"</option>"
RS.MoveNext
Loop
Response.Write "</select>"
Rs.Close
conn.Close
%>
</body>
</html>
Any JS experts able to help???
Thanks
Fiorano1
|
|
|
|
|
|
|
// |