find fejlen i dynamisk opdatering af listmenu
jeg får fejl med nedenstående kode - jeg har kigget på den så lang tid et jeg er blevet blind. kan jeg få hjælp til at finde fejlen :)<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="../../Connections/scandlines.asp" -->
<%
<%
Dim rsLand
Dim rsLand_numRows
Set rsLand = Server.CreateObject("ADODB.Recordset")
rsLand.ActiveConnection = MM_scandlines_STRING
rsLand.Source = "SELECT * FROM Land ORDER BY Land ASC"
rsLand.CursorType = 0
rsLand.CursorLocation = 2
rsLand.LockType = 1
rsLand.Open()
rsLand_numRows = 0
%>
<%
Dim rsDistrikt__varLand
rsDistrikt__varLand = "1"
If (Request.QueryString("Land") <> "") Then
rsDistrikt__varLand = Request.QueryString("Land")
End If
%>
<%
Dim rsDistrikt
Dim rsDistrikt_numRows
Set rsDistrikt = Server.CreateObject("ADODB.Recordset")
rsDistrikt.ActiveConnection = MM_scandlines_STRING
If (Request.Querystring("Land") <> "") Then
rsDistrikt.Source = "SELECT * FROM Distrikt WHERE Land = '" + Replace(rsDistrikt__varLand, "'", "''") + "' ORDER BY Distrikt ASC"
Else
rsDistrikt.Source = "SELECT * FROM Distrikt ORDER BY Distrikt ASC"
End If
rsDistrikt.CursorType = 0
rsDistrikt.CursorLocation = 2
rsDistrikt.LockType = 1
rsDistrikt.Open()
rsDistrikt_numRows = 0
%>
<%
Dim rsLandSelected__varLand
rsLandSelected__varLand = "1"
If (Request.Querystring("Land") <> "") Then
rsLandSelected__varLand = Request.Querystring("Land")
End If
Dim rsLandSelected
Dim rsLandSelected_numRows
Set rsLandSelected = Server.CreateObject("ADODB.Recordset")
rsLandSelected.ActiveConnection = MM_scandlines_STRING
rsLandSelected.Source = "SELECT * FROM Land WHERE Land = '" + Replace(rsLandSelected__varLand, "'", "''") + "' ORDER BY Land ASC"
rsLandSelected.CursorType = 0
rsLandSelected.CursorLocation = 2
rsLandSelected.LockType = 1
rsLandSelected.Open()
rsLandSelected_numRows = 0
%>
<script language="JavaScript">
function updatedistrikt(value) {
window.location = "search.asp?Land="+value;
}
</script>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form action="/search.asp" method="post" name="searchdistrikt" target="_top" id="searchdistrikt">
<table border="0" cellspacing="0" cellpadding="3">
<tr>
<td class="menuHead">søgning</td>
</tr>
<tr>
<td><select name="Land" id="Land" class="searchFields" onChange="updatedistrikt(value)">
<option value="">Vælg Land</option>
<%
While (NOT rsLand.EOF)
%>
<option value="<%=(rsLand.Fields.Item("Land").Value)%>"<%If (rsLand.Fields.Item("Land").Value) = rsLandSelected__varLand Then Response.Write(" SELECTED") End If%>><%=(rsLand.Fields.Item("Land").Value)%>
<%
rsLand.MoveNext()
Wend
If (rsLand.CursorType > 0) Then
rsLand.MoveFirst
Else
rsLand.Requery
End If
%>
</select></td>
</tr>
<tr>
<td><select name="Distrikt" id="Distrikt" class="searchFields">
<option value="">Vælg distrikt</option>
<%
While (NOT rsDistrikt.EOF)
%>
<option value="<%=(rsDistrikt.Fields.Item("Distrikt").Value)%>"><%=(rsDistrikt.Fields.Item("Distrikt").Value)%></option>
<%
rsDistrikt.MoveNext()
Wend
If (rsDistrikt.CursorType > 0) Then
rsDistrikt.MoveFirst
Else
rsDistrikt.Requery
End If
%>
</select></td>
</tr>
<tr>
<td align="right">
<input name="Submit" type="submit" class="buttons" value="Søg">
</td>
</tr>
</table>
</form>
</body>
</html>
<%
rsLand.Close()
Set rsLand = Nothing
%>
<%
rsDistrikt.Close()
Set rsDistrikt = Nothing
%>
<%
rsLandSelected.Close()
Set rsLandSelected = Nothing
%>
