当前位置: 代码迷 >> Java相关 >> asp页面中,点击select“省”一栏,“市”没有发生改变,求解!该如何处理
  详细解决方案

asp页面中,点击select“省”一栏,“市”没有发生改变,求解!该如何处理

热度:923   发布时间:2013-02-25 21:50:16.0
asp页面中,点击select“省”一栏,“市”没有发生改变,求解!!!
<%
dim count33
set rs33=server.createobject("adodb.recordset")
rs33.open "select * from area ",conn,1,1
%>
<script language = "JavaScript">
var onecount33;
onecount33=0;
subcat33 = new Array();

<%
  count33 = 0
  do while not rs33.eof 
%>
subcat33[<%=count33%>] = new Array("<%= trim(rs33("title"))%>","<%= rs33("fl")%>","<%= rs33("id")%>");

<%
  count33 = count33 + 1
  rs33.movenext
  loop
  rs33.close
%>

onecount33=<%=count33%>;


function changelocation3(locationid)
  {
alert('输出');
  document.myform.shi.length = 0; 

  var locationid=locationid;
  var i;
  for (i=0;i < onecount33; i++)
  {
  if (subcat33[i][1] == locationid)
  { //这句不是很理解
  document.myform.shi.options[document.myform.shi.length] = new Option(subcat33[i][0], subcat33[i][2]);
  }  
  }
   
  }
function changelocation4(locationid)
  {
  document.myform.qu.length = 0; 

  var locationid=locationid;
  var i;
  for (i=0;i < onecount33; i++)
  {
  if (subcat33[i][1] == locationid)
  { //这句不是很理解
  document.myform.qu.options[document.myform.qu.length] = new Option(subcat33[i][0], subcat33[i][2]);
  }  
  }
   
  }  

  
</script>


<%
dim count4
set rs4=server.createobject("adodb.recordset")
rs4.open "select * from area ",conn,1,1
%>
<script language = "JavaScript">
var onecount4;
onecount4=0;
subcat4 = new Array();

<%
  count4 = 0
  do while not rs4.eof 
%>
subcat4[<%=count4%>] = new Array("<%= trim(rs4("title"))%>","<%= rs4("fl")%>","<%= rs4("id")%>");

<%
  count4 = count4 + 1
  rs4.movenext
  loop
  rs4.close
%>

onecount4=<%=count4%>;

 
function changelocation4(locationid)
  {
  document.myform.qu.length = 0; 

  var locationid=locationid;
  var i;
  for (i=0;i < onecount4; i++)
  {
  if (subcat4[i][1] == locationid)
  { //这句不是很理解
  document.myform.qu.options[document.myform.qu.length] = new Option(subcat4[i][0], subcat4[i][2]);
  }  
  }
   
  }  
</script>




  省份:
  <select name="sheng" size="1" id="sheng" onChange="changelocation3(document.myform.sheng.options[document.myform.sheng.selectedIndex].value)">
  <option value="<%=rs("id")%>" selected><%=trim(rs("title"))%></option>
  <%  
dim ss
  ss=rs("id")
  rs.movenext
  do while not rs.eof
%>
  <option value="<%=rs("id")%>"><%=trim(rs("title"))%></option>
  相关解决方案