JSP 哪位老兄会二级下拉菜单啊,教下吧
就像论坛注册的那种,在第一个下拉菜单选择省后,在第二个下拉菜单会动态的变成相应的城市。。
会的大哥教下,感谢~
------解决方案-------------------- <form name= "form1 " method= "post " action= " ">
<select name= "City " onChange= "javascript:sprice(form1.Area,this.value) ">
</select>
<select name= "Area ">
<option value= "0 " selected> 所有区县 </option>
</select>
</form>
<script language= "JavaScript ">
function AddItemCity(seSelect)
{
<%
'城市
Set rs=Server.CreateObject( "ADODB.Recordset ")
strSql= "SELECT * FROM 城市 "
rs.Open strSql, conn, 1, 1
for i=1 to rs.recordcount
%>
seSelect.add(new Option( " <%=rs(0)%> ", " <%=rs(1)%> "));
<%
rs.MoveNext
next
rs.close
%>
}
function sprice(seSelect,val)
{
s=seSelect.length;
for (i = 0; i < s; i ++)
seSelect.options[0]=null;