ASP传值问题 单选按钮的值怎么在另外一个页面获取

<%ifnotrsVote.eofthenpages=2rsVote.pageSize=pagesallPages=rsVote.pageCount'计算一共能分多少页i... <%
if not rsVote.eof then
pages = 2
rsVote.pageSize = pages
allPages = rsVote.pageCount '计算一共能分多少页
if isEmpty(page) or Cint(page) < 1 then
page = 1
elseif Cint(page) > allPages then
page = allPages
end if
rsVote.AbsolutePage = page
j=1
Do while not rsVote.eof and pages > 0
%>
。。。。。。
<td align="center"> <%
if rsVote("VoteType")="Single" then
for i=1 to 8
if trim(rsVote("Select" & i) & "")="" then exit for
response.Write "<input type='radio' name='VoteOption' value='" & i & "' style='border:0'>" & rsVote("Select" & i) & "<br>"

next
response.Write("-------------------------------------------------------------------------------------------------------------------------------------------------")
else
for i=1 to 8
if trim(rsVote("Select" & i) & "")="" then exit for
response.Write "<input type='checkbox' name='VoteOption' value='" & i & "' style='border:0'>" & rsVote("Select" & i) & "<br>"
next
response.Write("-------------------------------------------------------------------------------------------------------------------------------------------------")

end if
%>
</td>
。。。。。。
<%
pages = pages - 1
rsVote.MoveNext
j=j+1
Loop

else
Response.Write("数据库暂无内容!")
End if
%>
展开
 我来答
cnlove
推荐于2016-12-01 · TA获得超过395个赞
知道小有建树答主
回答量:282
采纳率:0%
帮助的人:111万
展开全部
你自己分析下我的代码。

<div class="contentbox">
<form name="ckucun" method="post" action="ckucun.asp?try=post">
<label for="textfield"><strong>选择店铺:</strong>
<select style="width:150px;" name="dianid">
<option value="0">请选择店铺</option>
<%set rs=conn.execute("select id,dianname from dian order by id")
if not (rs.bof and rs.eof) then
do while not rs.eof
%>
<option value="<%=rs(0)%>"><%=rs(1)%></option>
<%
rs.movenext
loop
end if
set rs=nothing%>
</select></label>
<table width="100%">
<tr>
<th>是否配货(如果该店不配这个货请去掉勾选)</th>
<th>货名</th>
<th>大分类</th>
<th>小分类</th>
<th>型号</th>
<th>编码</th>
<th>件数</th>
</tr>
<tbody>
<% set rs=server.CreateObject("adodb.recordset")
sql="select * from huo order by fenleida ,fenleixiao,id asc "
rs.open sql,conn,1,1
if not rs.bof and not rs.eof then
i=1
do while not rs.eof
%>
<tr <%if i mod 2 = 0 then%>class="alt"<%end if%>>
<td><input name="huoid" type="checkbox" id="huoid" checked="checked" value="<%=rs(0)%>" /></td>
<td><%=rs(1)%></td>
<td><%=getname(rs(4),"lei")%></td>
<td><%=getname(rs(5),"lei")%></td>
<td><%=rs(2)%></td>
<td><%=rs(3)%></td>
<td><input type="text" value="<%=application(rs(0))%>" name="jianshu<%=rs(0)%>" /></td>
</tr>
<%
i=i+1
rs.movenext
loop
else
%>
<tr>
<td><input type="checkbox" value="" name="checkall" /></td><strong></strong>
<td>没</td>
<td>有</td>
<td>商</td>
<td>品</td>
<td>!</td>
<td>!</td>
</tr>
<%end if%>
</tbody>
</table>
<div class="extrabottom">
<ul>
<li><img src="img/icons/icon_edit.png" alt="Edit" /> 编辑</li>
<li><img src="img/icons/icon_approve.png" alt="Approve" /> 审核</li>
<li><img src="img/icons/icon_unapprove.png" alt="Unapprove" /> 禁止</li>
<li><img src="img/icons/icon_delete.png" alt="Delete" /> 删除</li>
</ul>
<div class="bulkactions">
<input type="submit" value="保存初始库存" class="btn" />
</div>
</div>
<%
rs.close
set rs=nothing%>
</form>
<div style="clear: both;"></div>
</div>

================
注意我的 name="jianshu<%=rs(0)%>"

处理程序

if saferequest("try",0)="post" then '保存初始库存
dianid=saferequest("dianid",1)
huoid=split(saferequest("huoid",0),", ") '将获取到的所有货ID转换成数组。
for kc=0 to ubound(huoid) '1.先保存各商品的库存值。方便下次输入。
application(huoid(kc))=saferequest("jianshu"&huoid(kc),0)
next

if dianid<1 then '2.验证是否选择了店铺。这个放在保存库存值之后,是为了。防止用户辛辛苦苦写输入的库存值。因为忘记选择店铺而把数据毁于一旦。
response.Write "<script>alert('请选择店铺!');"&vbcrlf
response.Write "document.location.href='ckucun.asp';</script>"
response.End()
end if

for kcu=0 to ubound(huoid) '3.入库操作,就是为了2 才把这一步与1 分开来。本来可以合在一起的。
set rsshifou=conn.execute("select id from kucun where huoid="&huoid(kcu)&" and dianid="&dianid)
if rsshifou.bof and rsshifou.eof then '不存在记录时,插入新记录
conn.execute("insert kucun(huoid,dianid,shuliang,beizhu) values('"&huoid(kcu)&"','"&dianid&"','"&saferequest("jianshu"&huoid(kcu),0)&"','批量添加于"&now()&"')")
else '存在此记录时,更新记录
conn.execute("update kucun set shuliang="&saferequest("jianshu"&huoid(kcu),0)&" where huoid="&huoid(kcu)&" and dianid="&dianid)
end if
next
response.Write "<script>alert('保存初始库存状态成功,所有库存数据已经入库。请勿轻易改动。');"
response.Write "document.location.href='ckucun.asp';</script>"
response.End()
end if
田响建站
2011-08-13 · 田响建站,纯手工建网站
田响建站
采纳数:3384 获赞数:2327

向TA提问 私信TA
展开全部
用数组
for i = 0 to ubound(n)
........
next
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式