我用onchange()把hwselecttext(数据库的内容'1、2、3、4、5')传递过去,为什么总是报'1、2、3、4、5'未定义错误。

cnqj_cn 2009-08-09 04:17:36
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="Connections/conn.asp" -->
<%
Dim Recordset1
Dim Recordset1_numRows

Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_conn_STRING
Recordset1.Source = "SELECT * FROM menu_bzaj_dw"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()

Recordset1_numRows = 0
%>
<%
Dim Recordset2
Dim Recordset2_numRows

Set Recordset2 = Server.CreateObject("ADODB.Recordset")
Recordset2.ActiveConnection = MM_conn_STRING
Recordset2.Source = "SELECT * FROM menu_bzaj_dw1"
Recordset2.CursorType = 0
Recordset2.CursorLocation = 2
Recordset2.LockType = 1
Recordset2.Open()

Recordset2_numRows = 0
dim hwselecttext
do while not recordset2.eof
hwselecttext=hwselecttext+recordset2(0)
recordset2.movenext
loop
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<script language="javascript">
function change_menu (x)
{
document.form1.select2.length=5;
document.form1.select2.options(0).text=x;
}
</script>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档 </title>
</head>

<body>
<form id="form1" name="form1" method="post" action="">
<label>
<select name="select" onchange="change_menu( <%=hwselecttext%>)">
<%
While (NOT Recordset1.EOF)
%>
<option value=" <%=(Recordset1.Fields.Item("dw").Value)%>"> <%=(Recordset1.Fields.Item("dw").Value)%> </option>
<%
Recordset1.MoveNext()
Wend
If (Recordset1.CursorType > 0) Then
Recordset1.MoveFirst
Else
Recordset1.Requery
End If
%>
</select>
</label>
<label>
<select name="select2">
</select>
</label>
</form>
</body>
</html>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>
<%
Recordset2.Close()
Set Recordset2 = Nothing
%>

我用onchange()把hwselecttext(数据库的内容'1、2、3、4、5')传递过去,为什么总是报'1、2、3、4、5'未定义错误。
希望那位大哥帮我解决,感激不尽.
...全文
33 3 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
cnqj_cn 2009-08-09
  • 打赏
  • 举报
回复
谢谢.
toury 2009-08-09
  • 打赏
  • 举报
回复
<select name="select" onchange="change_menu('<%=hwselecttext%>')">
hookee 2009-08-09
  • 打赏
  • 举报
回复
onchange="change_menu('<%=hwselecttext%>');">

28,409

社区成员

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

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