I have a form that has a drop down list that I am getting the values of from the database. It also runs a query when opening to list all entries in the database. Now I need to send the value of one of the items selected in the drop down to narrow down the list using a "Go" button. I had it working so that it passed the value and returned the right records but now it's not working. I also need it to keep the previously selected item from the drow down list.
This is what I have:
Set objConn = Server.CreateObject("adodb.Connection")
objConn.ConnectionString = CONN_STRING
objConn.CursorLocation = 3
objConn.Open
Set objRs = Server.CreateObject("adodb.Command")
objRs.ActiveConnection = objConn
objRs.CommandType = &H0004
objRs.CommandText = "stoSelectJurisdiction"
Set objRs = objRs.Execute
Set objConn2 = Server.CreateObject("adodb.Connection")
objConn2.ConnectionString = CONN_STRING
objConn2.CursorLocation = 3
objConn2.Open
Set objRs2 = Server.CreateObject("adodb.Command")
objRs2.ActiveConnection = objConn
objRs2.CommandType = &H0004
objRs2.CommandText = "stoSelectJurAccount"
objRs2.Parameters.Append _
objRs2.CreateParameter("JurID", adInteger, adParamInput, 4, JurID)
Set objRs2 = objRs2.Execute ' Execute stored procedure
<form method="post" action="JurAcct.asp?JurID=<%= JurID %>" name="frmServiceRequest">
<Select Name="JurID">
<option value="All" selected> All</option>
<% do while not objRs.EOF
If objRs("Organization") <> "" Then
If objRs("JurID") = Session("select" & JurID) Then
%>
<option value="<%= objRs("JurID") %>" selected><%= objRs("Organization") %>
</option>
<%
Else
%>
<option value="<%= objRs("JurID") %>"><%= objRs("Organization") %>
</option>
<%
End If
Else
End If
objRs.movenext()
loop
response.write "</select>"
%>
</select>
<input type=submit value="Go" id="btnGo" name="submit"></td>
<input type="hidden" name="JurID" value="<%= JurID %>">
Any suggestions?
This is what I have:
Set objConn = Server.CreateObject("adodb.Connection")
objConn.ConnectionString = CONN_STRING
objConn.CursorLocation = 3
objConn.Open
Set objRs = Server.CreateObject("adodb.Command")
objRs.ActiveConnection = objConn
objRs.CommandType = &H0004
objRs.CommandText = "stoSelectJurisdiction"
Set objRs = objRs.Execute
Set objConn2 = Server.CreateObject("adodb.Connection")
objConn2.ConnectionString = CONN_STRING
objConn2.CursorLocation = 3
objConn2.Open
Set objRs2 = Server.CreateObject("adodb.Command")
objRs2.ActiveConnection = objConn
objRs2.CommandType = &H0004
objRs2.CommandText = "stoSelectJurAccount"
objRs2.Parameters.Append _
objRs2.CreateParameter("JurID", adInteger, adParamInput, 4, JurID)
Set objRs2 = objRs2.Execute ' Execute stored procedure
<form method="post" action="JurAcct.asp?JurID=<%= JurID %>" name="frmServiceRequest">
<Select Name="JurID">
<option value="All" selected> All</option>
<% do while not objRs.EOF
If objRs("Organization") <> "" Then
If objRs("JurID") = Session("select" & JurID) Then
%>
<option value="<%= objRs("JurID") %>" selected><%= objRs("Organization") %>
</option>
<%
Else
%>
<option value="<%= objRs("JurID") %>"><%= objRs("Organization") %>
</option>
<%
End If
Else
End If
objRs.movenext()
loop
response.write "</select>"
%>
</select>
<input type=submit value="Go" id="btnGo" name="submit"></td>
<input type="hidden" name="JurID" value="<%= JurID %>">
Any suggestions?