主题:select控制
learnalearn
[专家分:0] 发布于 2007-03-16 10:01:00
<select>
<option>1</option>
<option>2</option>
</select>
我希望通过代码控制显示的option,
如第一次打开网页显示1,
如第二次打开网页显示2。
哪位指点一下,谢谢!
回复列表 (共3个回复)
沙发
wangsdong [专家分:21390] 发布于 2007-03-16 10:23:00
<option selected>1<option>这样就显示第一页
<option selected>2<option>……二……
得到当前是第几页,在那个option中加上selected就可以了
板凳
learnalearn [专家分:0] 发布于 2007-03-16 11:16:00
非常感谢,但我需要动态处理显示。也就是
<select>
<option>1</option>
<option>2</option>
</select>
已经固定,但进入网页时我想自由选择显示哪一个option!
3 楼
wangsdong [专家分:21390] 发布于 2007-03-16 11:26:00
<% page=request("page")%>
<select>
<option <% if page=1 then response.write "selected"%>>1</option>
<option <% if page=2then response.write "selected"%>>2</option>
</select>
我来回复