28,409
社区成员




<span class="f12px180b">再选择题库类别:<select size="1" class="wenbenkuang" name="szShi" onChange="info()">
function info(){
document.getElementById("sj").innerHTML="当前选择题库:<font color='#ff0000'>"+document.userinfo.szSheng.options[document.userinfo.szSheng.selectedIndex].text+"</font> 类别: <font color='#ff0000'> "+document.userinfo.szShi.options[document.userinfo.szShi.selectedIndex].text+"</font>";
document.userinfo.lbmc.value=document.userinfo.szSheng.options[document.userinfo.szSheng.selectedIndex].text;
}
function val()
{
var dl=document.getElementById(下拉框名);
var txt=document.getElementById(文本框名)
if(dl.options[dl.selectedIndex].innerText=="是")
{
if(txt.value=="")
{
alert('请输入文本框内容');
txt.focus();
return false;
}
}
return true;
}
<%dim sql,i,j
dj = int(session("dj"))
set rs_d=server.createobject("adodb.recordset")
'response.Write(dj)
'response.End()
if dj = 1 then
sql="select * from test_lb where id=15 order by id"
elseif dj = 2 then
sql="select * from test_lb where id=15 or id=16 order by id"
else
sql="select * from test_lb order by id"
end if
'set rs_d=server.createobject("adodb.recordset")
'sql="select * from test_lb order by id"
rs_d.open sql,conn,1,1
%>
var selects=[];
selects['mr']=new Array(new Option('请选择子栏目……','mr'));
<%
for i=1 to rs_d.recordcount
%>
selects['<%=rs_d("id")%>']=new Array(
<%
set rs_x=server.createobject("adodb.recordset")
sql="select * from test_xlb where lbid="&rs_d("id")&" order by id"
rs_x.open sql,conn,1,1
if rs_x.recordcount>0 then
for j=1 to rs_x.recordcount
set rs_t=server.createobject("adodb.recordset")
sqll="select * from test_tm where xlbid="&rs_x("id")
rs_t.open sqll,conn,1,1
tmsl=rs_t.recordcount
rs_t.close
if j=rs_x.recordcount then
%>
new Option('<%=trim(rs_x("xlbmc"))%>--从<%=tmsl%>道题目中抽取--','<%=trim(rs_x("id"))%>'));
<% else
%>
new Option('<%=trim(rs_x("xlbmc"))%>--从<%=tmsl%>道题目中抽取--','<%=trim(rs_x("id"))%>'),
<%
end if
rs_x.movenext
next
else
%>
new Option('','0'));
<%
end if
rs_x.close
rs_d.movenext
next
rs_d.close
%>
<select size="1" class="wenbenkuang" name="szSheng" onChange="chsel()">
<option value="xxx" selected>....请选择题库....</option>
<%do until rs_d.eof%>
<option value="<%=rs_d("id")%>"><%=rs_d("lbmc")%></option> <%
rs_d.movenext
loop
%>
</select>
function chsel(){
with (document.userinfo){
if(szSheng.value) {
szShi.options.length=0;
for(var i=0;i<selects[szSheng.value].length;i++){
szShi.add(selects[szSheng.value][i]);
}
}
}
document.getElementById("sj").innerHTML="当前选择题库:<font color='#ff0000'>"+document.userinfo.szSheng.options[document.userinfo.szSheng.selectedIndex].text+"</font> 类别: <font color='#ff0000'> "+document.userinfo.szShi.options[document.userinfo.szShi.selectedIndex].text+"</font>";
document.userinfo.lbmc.value=document.userinfo.szSheng.options[document.userinfo.szSheng.selectedIndex].text;
}
function IsDigit()
{
return ((event.keyCode >= 48) && (event.keyCode <= 57));
}