How do I position a dropdown to a defined option.
I have a dropdown that is populated from a table.
I can get the id or text variable for the dropdown items from a querystring.
Sections of my code looks like this so far
Any ideas?
Paul
<%
dim ID
dim iSystem
dim sSystem
ID = request.querystring("KBID"
set OrigRs = Server.CreateObject("ADODB.recordset"
sqlOrig="Select * FROM tblKnowledgeBase WHERE KBID =" & ID
OrigRs.Open sqlOrig, conn
iSystem = OrigRs.fields("KBSystemId"
sSystem = OrigRs.fields("KBSystem"
OrigRs.close
%>
<form method="POST" action="KBUpdate.asp">
<table width="612">
<td width="217">
<font size="2">
<%
'SYSTEM DROPDOWN
set rs = Server.CreateObject("ADODB.recordset"
sqlSystem="Select KBSystemID, KBSystem from tblKnowledgeBaseSystem ORDER BY KBSystem"
rs.Open sqlSystem, conn
%>
System</font>
</td>
<td width="470">
<Select Name = "KBSystemID" size="1">
<%
If not(rs.EOF AND rs.BOF) Then
rs.MoveFirst
Do until rs.EOF
Response.Write "<option value=" & rs("KBSystemID"
& ">" & rs("KBSystem"
& "</option>"
rs.MoveNext
Loop
End If
rs.close
%>
</select>
</td>
I have a dropdown that is populated from a table.
I can get the id or text variable for the dropdown items from a querystring.
Sections of my code looks like this so far
Any ideas?
Paul
<%
dim ID
dim iSystem
dim sSystem
ID = request.querystring("KBID"
set OrigRs = Server.CreateObject("ADODB.recordset"
sqlOrig="Select * FROM tblKnowledgeBase WHERE KBID =" & ID
OrigRs.Open sqlOrig, conn
iSystem = OrigRs.fields("KBSystemId"
sSystem = OrigRs.fields("KBSystem"
OrigRs.close
%>
<form method="POST" action="KBUpdate.asp">
<table width="612">
<td width="217">
<font size="2">
<%
'SYSTEM DROPDOWN
set rs = Server.CreateObject("ADODB.recordset"
sqlSystem="Select KBSystemID, KBSystem from tblKnowledgeBaseSystem ORDER BY KBSystem"
rs.Open sqlSystem, conn
%>
System</font>
</td>
<td width="470">
<Select Name = "KBSystemID" size="1">
<%
If not(rs.EOF AND rs.BOF) Then
rs.MoveFirst
Do until rs.EOF
Response.Write "<option value=" & rs("KBSystemID"
rs.MoveNext
Loop
End If
rs.close
%>
</select>
</td>