帮忙减肥。。。

greenhornH 2005-07-19 12:32:27
不想用hidden。

index.asp
---------
<script>
function fnc(){
frm.method="post";
frm.action="checkbox.asp";
frm.submit();
}
function fncA(a){
if (frm.all("chk")[a].checked)
{frm.all("hdn")[a].value=1;}
else
{frm.all("hdn")[a].value=0;}
}

</script>
<form name="frm">
<%Dim intI
response.write "<table border=1>"
For intI=0 to 9
response.write "<tr><td><input type='checkbox' name='chk' value='off' onclick='fncA("& intI &");'>"
response.write "<input type='hidden' name='hdn' value='0'></td>"
response.write "<td><input type='text' name='txt' value='" & intI+100 &"'></td></tr>"
Next
response.write "</table>"
%>
<input type="hidden" value="<%=intI%>" name="allCount">
<input type="button" value="Submit" onclick="fnc();">
---------------------------------------------




checkbox.asp
-----
<%
Dim intCnt
Dim rs
Dim boo
intCnt=Request.Form("allCount")
'Response.write Request.Form("chk")
'response.end
rs = Split(Request.Form("txt"),",")
boo= Split(Request.Form("hdn"),",")
For i=0 to Ubound(rs)
if boo(i)=1 then
Response.write rs(i) & "<br>"
end if
Next
%>
...全文
88 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
net205 2005-08-03
  • 打赏
  • 举报
回复
不知道直接把值给chk满足你的要求不???
<script>
function fnc(){
frm.method="post";
frm.action="checkbox.asp";
frm.submit();
}
</script>
<form name="frm">
<%
Dim intI
response.write "<table border=1>"
For intI=0 to 9
response.write "<tr><td><input type='checkbox' name='chk' value='"&intI+100&"'></td></tr>"
Next
response.write "</table>"
%>
<input type="button" value="Submit" onclick="fnc();">


另一个页厘 :
Response.Write Replace(Request.Form("chk"),",","<br/>")
greenhornH 2005-08-03
  • 打赏
  • 举报
回复
啊,不好意思,耽误大家时间了。

第一页,有一串checkbox,每个checkbox后面跟一个数值。

在选择checkbox,并且,提交到第二个页面。

如果checkbox在第一个页面内是checked,则在第二个页面显示后面的数值。否则不显示,我是通过hidden实现的。代码显得很臃肿。

ok?
x123jing 2005-08-01
  • 打赏
  • 举报
回复
不晓得是什么意思
greenhornH 2005-08-01
  • 打赏
  • 举报
回复
!!!
shubo2000 2005-08-01
  • 打赏
  • 举报
回复
请楼主对大家的时间负责
把两段代码的功能大致解释一下
wxylvmnn 2005-08-01
  • 打赏
  • 举报
回复
路过‘困~没看~
huo789 2005-08-01
  • 打赏
  • 举报
回复
不清楚什么意思
greenhornH 2005-07-20
  • 打赏
  • 举报
回复
啊?

没人搭理我。。。。
greenhornH 2005-07-20
  • 打赏
  • 举报
回复
不是吧~问题很难么?

28,390

社区成员

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

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