Hi,
I am at present using the code below to get the dropdown box to populate with data from an access database.
However I would now like to create a second dropdown, but I would like the data displayed to depend on the choice of the first box.
Example: If I choose colours in box one, box two only shows colours.
In my database I have the following data:-
id system query
1 internet admin
2 internet project
3 intranet admin
4 intranet project
Code:
<% Option Explicit %>
<%
Dim adoCon, strCon, rs, strSQL, strID
strID = Request.QueryString("select1")
if strID = "" then
Set strCon = Server.CreateObject("ADODB.Connection")
Set rs = Server.CreateObject("ADODB.Recordset")
strCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" &Server.MapPath("db")
strSQL = "SELECT * FROM table ORDER BY system ASC"
rs.Open strSQL,strCon
%>
<html>
<head>
<title>Combo Test</title>
</head>
<body>
<form method="POST" action="next.asp">
<table border=0>
<tr>
<td>System</td>
<td>
<select size="1" id="select1" name="select1">
<%
While NOT rs.EOF
%>
<option value="<%=rs("system")%>"><%=rs("system")%>&l t;/option>
<%
rs.MoveNext
WEND
%>
</select></td>
</tr>
</table>
<input type="submit" value="Submit" name="Go">
</form>
</body>
</html>
<%
rs.Close
strCon.Close
set rs = Nothing
set strCon = Nothing
else
Response.Redirect strID
end if
%>
Any Help, Suggestions, or tutorials would be appreciated.
Steve