asp定义数组 并用循环的方式获取数组内容 的方法
2017-02-21 13:14 写代码的渔夫 阅读(6329) 评论(0) 收藏 举报
<%
myArrayValue = Array("1","2","3","4")
myArrayName = Array("男孩","女孩","宝宝","母婴")
%>
<label>用户分类:
<select name="bTypeId" style="padding:5px; margin-bottom:10px;">
<option value="0">未分组</option>
<%
for i=0 to ubound(myArrayValue)
%>
<option value="<%=myArrayValue(i)%>" <%if rs.fields("bTypeId")=myArrayValue(i) then
response.Write("selected='selected'")
end if %>><%=myArrayName(i)%></option>
<%
next
%>
</select>
</label>
浙公网安备 33010602011771号