<select name="userdept" size=1 onChange="document.form1.submit();">
<% '读出部门
set rs=server.createobject("adodb.recordset")
sql="select DISTINCT department from oa.users"
rs.open sql,conn,1
if not rs.eof and not rs.bof then firstdept=rs("department")
if request("department")<>"" or not isnull(request("department")) then firstdept=request("department")
while not rs.eof and not rs.bof
%>
<option value="<%=rs("department")%>"<%=selected(firstdept,rs("userdept"))%>><%=rs("department")%></option>
<%
rs.movenext
wend
%>
</select>
中的selected(firstdept,rs("userdept"))什么意思?
...全文
2419打赏收藏
<select></select>用法
<% '读出部门 set rs=server.createobject("adodb.recordset") sql="select DISTINCT department from oa.users" rs.open sql,conn,1 if not rs.eof and not rs.bof then firstdept=rs("department")