************************ (1) Öffnen Sie den Datensatzsatz, erstellen Sie ein Array und weisen Sie den Wert des Datensatzes dem Array zu.
<%
Dimcount
setrs = server.createObject ("adodb.recordset")
SQL = "SELECT*FROMBOOMBOARDSBYCLASSIDDESC"
Rs.opensql, CN, 1,1%>
<criptuanguage = "javaScript">
varonecount;
OneCount = 0;
subcat = newArray ();
<%count = 0
dowhilenotrs.eof%>
subcat [<%= count%>] = newArray ("<%= trim (rs (" boardname ")%>", "<%= trim (rs (" classid ")%>");
<%count = count+1
Rs.Movenext
Schleife
Rs.close%>
OneCount = <%= count%>;
FunktionChangelocation (StandortID)
{document.form1.boardid.length = 0;
varLocationId = locationId;
vari;
für (i = 0; i <OneCount; i ++)
{if (subcat [i] [1] == locationId)
{document.form1.boardid.options [document.form1.boardid.length] = newOption (subcat [i] [0], subcat [i] [2]);
}}}
</script>
************************ (ii) Gruppierung anzeigen und das Onchange -Ereignis des Listenfelds schreiben.
<%setrs = server.createObject ("adodb.recordset")
SQL = "SELECT*FROMBOOKCLASSORDSBYCLASSIDDESC"
Rs.opensql, CN, 1,1
ifrs.eofandrs.Bofthen
Antwort.Write "Bitte fügen Sie zuerst die Gesamtklasse hinzu."
Antwort.end
sonst%>
<selectName = "classId" onchange = "änderung (document.form1.classid.options [document.form1.classid.selectedIndex] .Value)">
<optionsEltedValue = ""> == Bitte wählen Sie die Hauptkategorie == </Option>
<%dountilrs.eof%>
<optionValue = "<%= trim (rs (" classId ")%>"> <%= trim (rs ("className")%> </option>
<%Rs.Movenext
Schleife
Endif
Rs.close
setrs = nichts%>
</select>
<SelectName = "BoardID"> <optionsEltedValue = ""> == Bitte wählen Sie Unterkategorie == </option>
</select>