<script language="javascript">
<!--
//**************************************************
function del_options( mdl, cnt ) {
while( mdl.options.length > cnt ) mdl.options[cnt] = null;
}
//**************************************************
function set_option( mdl, ndx, txt, vl ) {
mdl.options[ndx] = new Option(txt,vl);
}
//*********************************************
function a_onchange( mark, mdl ) {
var total = mdl.length-1;
for (j=0;j<=total;j++) {
del_options(mdl,j);
}
<%
rs.open "select * from a ",cn
do while not rs.eof
rs1.open "select * from b" ,cn
i=0
do while not rs1.eof
%>
if ('<%=trim(rs("f_item"))%>' == mark) {
set_option(mdl,<%=i%>,'<%=trim(rs1("field_mean"))%>','<%=trim(rs1("field_mean"))%>');
}
<%
i=i+1
rs1.movenext
loop
rs1.close
rs.movenext
loop
rs.close
%>
}
//-->
</script>
<select name="cbo_a" style="HEIGHT: 22px; WIDTH: 140px" onchange="a_onchange(document.form1.cbo_a.options.value,document.form1.cbo_b)">
<%
rs.Open "select * from a",cn
do while not rs.EOF
%>
<option value=<%=trim(rs("f_item"))%>><%=trim(rs("f_item"))%></option>
<%
rs.MoveNext
loop
rs.Close
%>
</select>
<select name="cbo_b" style="HEIGHT: 22px; WIDTH: 138px"></select>