Forums
This topic is locked
problem with dynamic menu list boxes
Posted 18 Sep 2007 08:27:40
1
has voted
18 Sep 2007 08:27:40 mafilee malam posted:
i've got two menu list in one form. problem with my menu that my child menu did not give any respose to my parent menu. maybe i have to add javascript code but i dunno where and which function i suppose to use.. plz help me to make this form succeed..This is the Code:
<pre id=code><font face=courier size=2 id=code>
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="Connections/TMDS.asp" -->
<%
Dim rsLicense
Dim rsLicense_numRows
Set rsLicense = Server.CreateObject("ADODB.Recordset"
rsLicense.ActiveConnection = MM_TMDS_STRING
rsLicense.Source = "SELECT distinct License FROM dbo.Package"
rsLicense.CursorType = 0
rsLicense.CursorLocation = 2
rsLicense.LockType = 1
rsLicense.Open()
rsLicense_numRows = 0
%>
<%
Dim rsPackage__MMColParam
rsPackage__MMColParam = "%"
If (rsLicense.Fields.Item("License".Value <> "" Then
rsPackage__MMColParam = rsLicense.Fields.Item("License".Value
End If
%>
<%
Dim rsPackage
Dim rsPackage_numRows
Set rsPackage = Server.CreateObject("ADODB.Recordset"
rsPackage.ActiveConnection = MM_TMDS_STRING
rsPackage.Source = "SELECT PackageID, Content FROM dbo.Package WHERE License = '" + Replace(rsPackage__MMColParam, "'", "''" + "'"
rsPackage.CursorType = 0
rsPackage.CursorLocation = 2
rsPackage.LockType = 1
rsPackage.Open()
rsPackage_numRows = 0
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_callJS(jsStr) { //v2.0
return eval(jsStr)
}
//-->
</script>
</head>
<body>
<form action="" method="get" name="form1">
<p>LICENSE:
<select name="listLicense" id="listLicense" >
<%
While (NOT rsLicense.EOF)
%>
<option value="<%=(rsLicense.Fields.Item("License".Value)%>"><%=(rsLicense.Fields.Item("License".Value)%></option>
<%
rsLicense.MoveNext()
Wend
If (rsLicense.CursorType > 0) Then
rsLicense.MoveFirst
Else
rsLicense.Requery
End If
%>
</select>
</p>
<p>PACKAGE :
<select name="ListPackage" id="ListPackage">
<%
While (NOT rsPackage.EOF)
%>
<option value="<%=(rsPackage.Fields.Item("PackageID".Value)%>" <%If (Not isNull((rsLicense.Fields.Item("License".Value))) Then If (CStr(rsPackage.Fields.Item("PackageID".Value) = CStr((rsLicense.Fields.Item("License".Value))) Then Response.Write("SELECTED" : Response.Write(""%>><%=(rsPackage.Fields.Item("Content".Value)%></option>
<%
rsPackage.MoveNext()
Wend
If (rsPackage.CursorType > 0) Then
rsPackage.MoveFirst
Else
rsPackage.Requery
End If
%>
</select>
</p>
</form>
</body>
</html>
<%
rsLicense.Close()
Set rsLicense = Nothing
%>
<%
rsPackage.Close()
Set rsPackage = Nothing
%>
</font id=code></pre id=code>
thanx in advance