|
1:首先是表单中的下拉列表: <form name="jiaoshi" > <% sql = "select * from room" set rs = server.createobject("adodb.recordset") rs.open sql,conn,1,1 %> <select name="jiaoshi" > <option value="" selected>请选择</option> <% do while not rs.eof %> <option value="<%=trim(rs("ro_name"))%>"><%=rs("ro_name")%></option> <% i=i+1 rs.movenext loop rs.close set rs = nothing %> </select> </form> 2:是下拉列表的onchange事件: <SCRIPT LANGUAGE="VBScript"> <!-- sub zhouci_onchange if xueqi.xueqi.value = "" Or jiaoshi.jiaoshi.value = "" Then MsgBox "不能为空选项,请选择学期.教室和周次!", vbOKOnly, "信息提示" zhouci.zhouzi.value="" exit sub else
wkn=1 Do While wkn <=35 strwkn=trim((wkn-1)+1) select case wkn case 1 <% sqltxt = "select * from yyxx where ro_name='"&request("document.jiaoshi.jiaoshi.options.value")&"' and we_name='第一周' and weekday_name=1 and jie_ci=12" set rs1 = server.createobject("adodb.recordset") rs1.open sqltxt,conn,1,1 if rs1.recordcount<>0 then %> msgbox "<%=trim(rs1("js_name"))%>,"&document.jiaoshi.jiaoshi.options.value&"" document.form1.button1.value="<%=trim(rs1("js_name"))%>" document.form1.button1.disabled=true <%else%> document.form1.button1.value="待定" <%end if%> end select 问题: 为什么ro_name='"&request("document.jiaoshi.jiaoshi.options.value")&"'取不到值啊 请高手们指教.... |
|