一个关于
的小问题求助

Jeroki 2002-06-28 09:32:00



<script><!--
function gopage(p){
document.all("mydiv").innerHTML = p;
}

//-->
</script>


<%
sql="select classs from leibie where classname='電腦配件'"
set rs=conn.execute(sql)

%>
<% i=0

do while not rs.eof %>//循環1
<tr bgcolor="e2eabf">
<td width="32" height="33">
<div align="center">
<%i=i+1%>
<%=i%></div>
</td>
<td width="93" height="33">
<div align="center">
<%=rs("classs")%>
<%cc=rs("classs")%>
</div>
</td>//獲取子類別

<td width="266" height="33">
<%
sql4="select * from chanpin where classname='電腦配件' and
classs='"&cc&"'"
set rs4=conn.execute(sql4) %>
<%if not rs4.eof then %>

<select name="spage"
onChange="javascript:gopage(this.value);">
<%do while not rs4.eof %>//循環2
<option value= <%=rs4("price")%>> <%=rs4("pm")%> <%p=rs4("price")%>
</option>
<% rs4.movenext
loop %>
</select></td>
<td height="33" width="104">
<div id="mydiv"></div>
</td>
<%else %>
<td height="33" width="104">
<div align="center">  </div>
</td>
<% end if %>
</tr>
<% rs.movenext
loop %>

請問何解:
<div id="mydiv"></div>始終不顯示值!而單單用循環2獨立的一個循環時 <div
id="mydiv"></div>又顯示值.
...全文
67 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
Jeroki 2002-06-29
  • 打赏
  • 举报
回复
3 K U
Jeroki 2002-06-28
  • 打赏
  • 举报
回复

你可以這樣改改!建軍GG:

<% sql="select classs from leibie where classname='電腦配件'"
set rs=conn.execute(sql) %>

<% i=0 %>

<%do while not rs.eof %>
<tr bgcolor="e2eabf">
<td width="32" height="33">
<div align="center">
<%i=i+1%>
<%=i%></div>
</td>
<td width="93" height="33">
<div align="center"> <%=rs("classs")%>
<%cc=rs("classs")%>
</div>
</td>

<td width="266" height="33">
<%
sql4="select * from chanpin where classname='電腦配件' and classs='"&cc&"'"
set rs4=conn.execute(sql4) %>
<% if not rs4.eof then %>

<select name="spage<%=i%>" onChange="javascript:gopage('mydiv<%=i%>',this.value);">//就是這裡哦!
<%do while not rs4.eof %>
<option value= <%=rs4("price")%> selected> <%=rs4("pm")%> <%p=rs4("price")%>
</option>

<% rs4.movenext
loop %>
</select>
</td>
<td height="33" width="104">
<div id=mydiv<%=i%>></div>
</td>
<%else %>
<td height="33" width="104">
<div align="center">  </div>
</td>
<% end if %>
</tr>
<%rs.movenext
loop %>

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧