江湖救急用asp获得下拉框值的问题(在线等,在线结帖!)

sunangle 2005-07-27 09:25:51
网页上有一下拉框值从数据库中读出产品的类(值为产品类的id),下面用iframe嵌套了一个产品asp页面获得下拉框onChange后的产品类的值,搞了好长时间写不好下拉框中的onChange语句和获得下拉框值传递到iframe中产品asp页面的javascript请各位帮忙
...全文
170 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
huo789 2005-07-28
  • 打赏
  • 举报
回复
因为现在很忙,没有时间看你这段代码,不知道我是否理解了你的意思
如果只是需要获得select的onchang后select的值

这个很简单
例如:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<script language="javascript">
function GetSelectValue() {
var theValue = document.form1.theSelect.value;
alert(theValue);
}
</script>
<body>
<form name="form1" method="post" action="">
<select name="theSelect" onChange="GetSelectValue()">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
</form>
</body>
</html>
你看一下你是否是这个意思?
sunangle 2005-07-27
  • 打赏
  • 举报
回复
hyzx_n.asp

<html>
<head><!--#include virtual="/include/head.asp" -->

<meta http-equiv="Content-Type" content="text/html; charset=gb2312"></head><STYLE type=text/css>BODY {
SCROLLBAR-FACE-COLOR: #f1f1f1; SCROLLBAR-HIGHLIGHT-COLOR: #f1f1f1; SCROLLBAR-SHADOW-COLOR: #D3CEBD; SCROLLBAR-3DLIGHT-COLOR: #ffffff; SCROLLBAR-ARROW-COLOR: #ffffff; SCROLLBAR-TRACK-COLOR: #f1f1f1; SCROLLBAR-DARKSHADOW-COLOR: #f1f1f1
}
</STYLE>

<body bgcolor="#f1f1f1" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<!--会员中心产品价格-->
<!--#include virtual="/modules/product_show_10/includes/config.asp"-->
<table width="300" border="0" cellpadding="10" cellspacing="0">
<tbody>

<%
if node_id<>"" then

set rs = dataExecute("SELECT * FROM Leaf_10 WHERE node_id='"&node_id&"'and Is_display<>0 and node_id<>1 and node_id<>2 and node_id<>3 order by Leaf_id desc",dsn_app)
else
set rs = dataExecute("SELECT * FROM Leaf_10 WHERE Is_display<>0 and Is_display<>0 and node_id<>1 and node_id<>2 and node_id<>3 order by Leaf_id desc",dsn_app)

end if
%><%
'set rs = dataExecute("SELECT * FROM product_show_10 WHERE PD_sort_id='"&node_id&"' and PD_display=0 order by PD_sort_id desc",dsn_app)
'set rs = dataExecute("select top 4 picture_6.leaf_id as leaf_id, picture_6.picture_name as picture_name, picture_6.alt as alt,leaf_6.Brief,leaf_6.Title from leaf_6,picture_6 where picture_6.leaf_id=leaf_6.leaf_id and leaf_6.Node_id=26 order by leaf_6.leaf_id desc",dsn_app)

if not rs.eof then
If Request("PageNo")="" then
PageNo=1
Else
PageNo=clng(Request("PageNo"))
End If

TotalRecs = rs.RecordCount
rs.Pagesize = 3
TotalPages = cInt(rs.PageCount)

rs.AbsolutePage = PageNo '记录集的当前页
y=0
For x = 1 to rs.PageSize
If rs.eof then
Exit For
Else
y=y+1
%>
<tr align="left" valign="top" >
<td height="56"> <table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#D6D7C1" class="85795416">
<tr align="center" valign="middle" bgcolor="#f1f1f1">
<td width="123" height="27"><strong>产品名称</strong></td>
<td width="63"><strong>规格</strong></td>
<td width="65"><strong>单价</strong></td>
</tr>
<tr align="center" valign="middle" bgcolor="#f1f1f1">
<td height="20"><%if len(trim(rs("Title")))>=6 then
Response.Write(left(rs("Title"),6))

else
Response.Write(rs("Title"))
end if
%></td>
<td><%if len(trim(rs("Title")))>=6 then
Response.Write(left(rs("Title"),6))

else
Response.Write(rs("Title"))
end if
%></td>
<td><%
if session("username")<>"" then
if len(trim(rs("cpccj")))>=6 then
Response.Write(left(rs("cpccj"),6))

else
Response.Write(rs("cpccj"))
end if
else
if len(trim(rs("cpgg")))>=6 then
Response.Write(left(rs("cpgg"),6))

else
Response.Write(rs("cpgg"))
end if
end if
%></td>
</tr>
</table> </td>
</tr>
<%
rs.MoveNext
End If
Next
else
%>
<tr><td> <%Response.Write("暂无信息!")%></td></tr>
<%
end if
%>
</table>
<%
if TotalPages>1 then
%>
<table width="300" border="0" cellspacing="0" cellpadding="0" class="85795416">
<form name="form1" method="post" action="/chinese/cpzx/hyzx_n.asp">
<tr>
<td bgcolor="#999999"><img src="/images/spacer.gif" width="1" height="1"></td>
</tr>
<tr>
<td height="25" align="left" valign="middle" >共<%=TotalRecs%>个
<%if PageNo=1 then%>
[首 页]  [上一页]
<% else %>
[<a href=hyzx_n.asp?PageNo=1&node_id=<%=node_id%> class="title0">首 页</a>]   [<a href=hyzx_n.asp?PageNo=<%=(PageNo-1)%>&node_id=<%=node_id%> class="title0">上一页</a>]
<%end if
if TotalPages-PageNo<1 then%>
[下一页]  [末 页]
<%else%>
[<a href=hyzx_n.asp?PageNo=<%=(PageNo+1)%>&node_id=<%=node_id%> class="title0">下一页</a>]  [<a href=hyzx_n.asp?PageNo=<%=TotalPages%>&node_id=<%=node_id%> class="title0">末 页</a>]
<%end if%>
</td>
</tr>
</form>
</table>
<%
end if
rs.close
set rs=nothing
%>
</body>
</html>


sunangle 2005-07-27
  • 打赏
  • 举报
回复

谢谢了,select的onchang我不会写,怎么把获得的select的值传到hyzx_n.asp上
cpclass.asp
<table width="316" height="238" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="left" valign="top" width="335" height="238">
<!--获得数据库连接--->
<!--#include virtual="/modules/product_show_10/includes/config.asp"-->
<% node_id = request.form("node_id")%>
<table width="300" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><form name="form2" method="post" action="hyzx.asp">
<table width="300" border="0" cellspacing="0" cellpadding="0">
<tr>
<%

'if node_id<>"" then
'set nrs = dataExecute("SELECT * FROM Node_10 WHERE node_id='"&node_id&"' and node_id<>2 and node_id<>3 order by node_id asc",dsn_app)
' else
set nrs = dataExecute("SELECT * FROM Node_10 WHERE node_id<>1 and node_id<>2 and node_id<>3 order by node_id asc",dsn_app) %>
<%if nrs.eof then
Response.Write("请添加产品类别!")
else
%>
<td width="229" height="30" class="85795416"><strong>请选择产品系列:</strong>
<select name="select" class="input-write">
<%do while not nrs.eof %>
<option selected value="<%=nrs("node_id")%>"><%=nrs("Name")%></option>
<%nrs.movenext
loop
end if
nrs.close
set nrs=nothing
%>
</select>
</td>
<td width="43" class="85795416"><input name="Submit4" type="image" value="提交" src="../images/go.gif" width="24" height="24" scr="image/go.gif"></td>
<td width="28" class="85795416"> </td>
<%'end if%>
</tr>
</table>
</form></td>
</tr>
</table>
<IFRAME id=att name=att
src="hyzx_n.asp" frameBorder=0 width="100%"
scrolling=yes height="80%">
</IFRAME></td>
</tr>
</table>

huo789 2005-07-27
  • 打赏
  • 举报
回复
你把你写的这一部分的代码贴出来啊
sunangle 2005-07-27
  • 打赏
  • 举报
回复
自己顶哈
sunangle 2005-07-27
  • 打赏
  • 举报
回复
搞错了,刚发不上去我给80专给

28,391

社区成员

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

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