Size örnek bir iki dropdown içeren ve ilişkili çalışan kod yazıyorum. Umarım bu işinizi çözer.
Halledemezseniz admin {@} uzmanim.net adresine kodlarinizi gonderebilirsiniz.
<%@ Language = VBscript %>
<html>
<head>
<title>Kategori-altkategori</title>
<script language=JavaScript>
function reload(form){
var val=form.dept.options[form.dept.options.selectedIndex].value;
self.location='emp.asp?dept=' + val ;
}
</script>
</head><body>
<%
Dim objconn,objRS,strSQL,dept
dept=Request.QueryString("dept")
Set objconn = Server.CreateObject("ADODB.Connection")
objconn.ConnectionString = "DRIVER=Microsoft Access Driver (*.mdb);DBQ=" & Server.MapPath("emp.mdb")
objconn.Open
Set objRs = Server.CreateObject("ADODB.Recordset")
'''''ilk dropdown burada'''''
strSQL = "SELECT distinct dept from emp_m"
objRS.Open strSQL, objconn
Response.Write "<form method=post name=f1 action=''><select name=dept onchange='reload(this.form)'><option value=''>Kategori seçin</option>"
Do While Not objRS.EOF
Response.Write "<option value=" & objRs("dept") & ">" & objRs("dept") & "</option>"
objRS.MoveNext
Loop
objRs.Close
Response.Write "</select>"
Response.Write "<br>----<br>"
''' ikinci dropdown burada ''''
If len(dept) > 1 Then
strSQL = "SELECT * FROM emp_m where dept='" & dept &"'"
objRS.Open strSQL, objconn
Response.Write "<select name=AltKategori>"
Do While Not objRS.EOF
Response.Write "<option value=" & objRs("emp_no") & ">" & objRs("name") & "</option>"
objRS.MoveNext
Loop
Response.Write "</select>"
Response.Write "</form>"
objRs.Close
objconn.Close
end if
%>
</body>
</html>