首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > ASP >

select的有关问题

2012-04-09 
select的问题optionvalue —请选择— /option%selected fori0toubound(otherdesc)ifrs( the

select的问题
<option   value= " "> —请选择— </option>
        <%  
      selected= " "
      for   i   =   0   to   ubound(otherdesc)
      if   rs( "thesource ")   =   otherdesc(i)   then   selected   =   "selected "
response.Write( " <option   value= ' "&otherdesc(i)& " '   "&selected& "> "&otherdesc(i)& " </option> ")
selected= " "
    next
    set   toconn=nothing
    %>
        </select>
我一直是用这个
但老觉得应该有更好的办法
不知道谁能说说呢


[解决办法]
应该没什么更好的方法了~
[解决办法]
if rs.eof then exit for
next
[解决办法]
<Select size= "1 " name= "thesource ">
<Option value= " " Selected> 全部
<%Set RS=Conn.Execute( "select thesource from thesourcetable ")
Do While NOT Rs.EOF%>
<Option value= " <%=Rs(0)%> "> <%=Rs(1)%>
<% Rs.movenext
Loop
Rs.close%>
</Select>

這樣也可以哦!
[解决办法]
一般情况下都是这样的

热点排行