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>

&lt;%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%&gt;
&lt;!--#include file="Connections/TMDS.asp" --&gt;

&lt;%
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
%&gt;
&lt;%
Dim rsPackage__MMColParam
rsPackage__MMColParam = "%"
If (rsLicense.Fields.Item("License".Value &lt;&gt; "" Then
rsPackage__MMColParam = rsLicense.Fields.Item("License".Value
End If
%&gt;
&lt;%
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
%&gt;
&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "www.w3.org/TR/html4/loose.dtd"&gt;
&lt;html&gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"&gt;
&lt;title&gt;Untitled Document&lt;/title&gt;
&lt;script language="JavaScript" type="text/JavaScript"&gt;
&lt;!--
function MM_callJS(jsStr) { //v2.0
return eval(jsStr)
}
//--&gt;
&lt;/script&gt;
&lt;/head&gt;

&lt;body&gt;
&lt;form action="" method="get" name="form1"&gt;
&lt;p&gt;LICENSE:
&lt;select name="listLicense" id="listLicense" &gt;
&lt;%
While (NOT rsLicense.EOF)
%&gt;
&lt;option value="&lt;%=(rsLicense.Fields.Item("License".Value)%&gt;"&gt;&lt;%=(rsLicense.Fields.Item("License".Value)%&gt;&lt;/option&gt;
&lt;%
rsLicense.MoveNext()
Wend
If (rsLicense.CursorType &gt; 0) Then
rsLicense.MoveFirst
Else
rsLicense.Requery
End If
%&gt;
&lt;/select&gt;
&lt;/p&gt;
&lt;p&gt;PACKAGE :
&lt;select name="ListPackage" id="ListPackage"&gt;
&lt;%
While (NOT rsPackage.EOF)
%&gt;
&lt;option value="&lt;%=(rsPackage.Fields.Item("PackageID".Value)%&gt;" &lt;%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(""%&gt;&gt;&lt;%=(rsPackage.Fields.Item("Content".Value)%&gt;&lt;/option&gt;
&lt;%
rsPackage.MoveNext()
Wend
If (rsPackage.CursorType &gt; 0) Then
rsPackage.MoveFirst
Else
rsPackage.Requery
End If
%&gt;
&lt;/select&gt;
&lt;/p&gt;
&lt;/form&gt;

&lt;/body&gt;
&lt;/html&gt;
&lt;%
rsLicense.Close()
Set rsLicense = Nothing
%&gt;
&lt;%
rsPackage.Close()
Set rsPackage = Nothing
%&gt;

</font id=code></pre id=code>

thanx in advance

Reply to this topic