<! - Ouvrez deux tables ->
<%
setrs1 = server.createObject ("adodb.recordSet")
sql1 = "select * fromType1"
RS1.OpenSQL1, Conn, 1,3
setrs2 = server.createObject ("adodb.recordSet")
sql2 = "select * fromType2"
RS2.OpenSQL2, Conn, 1,3
%>
<formName = "form1">
<! - Créer un menu ->
<lectName = "type" size = "1" onchange = "redirect (this.options.value)">
<optionValue = 0> Veuillez sélectionner ... </ Option>
<% whilenotrs1.eof%>
<optionValue = "<% = rs1 (" news_type_1_id ")%>"> <% = rs1 ("news_type_1_type")%> </ option>
<% RS1.MoVeNext
wend%>
</lect>
<! - Créez le menu 2 ->
<lectName = "type2" size = "1">
<optionValue = 0> Veuillez sélectionner </ Option>
</lect>
</div>
</ form>
<! - Ce qui suit est l'instruction de script pour l'implémentation spécifique ->
<cript>
<! -
vartemp = document.form1.type2
FunctionRedirect (x) {
Vari
i = 0
pour (varm = temp.options.length-1; m> 0; m--)
temp.options [m] = null
<% whilenotrs2.eof
%>
cnt = <% = rs2 ("news_type_1_id")%>
if (cnt == x) {
Temp.options = newOption ("<% = rs2 (" news_type_2_type ")%>", "<% = rs2 (" news_type_2_id ")%>")
i = i + 1}
<%
rs2.movènext
wend%>
}
// ->
</cript>