在form表单的checkbox中name的值可不可以用数组表示。各位大侠请救命啊!

wxylvmnn 2001-03-24 09:39:00
我要把checkbox的name的值在for循环中动态的加1,但是name的值好象是常量,用数组好象没什么用处,有什么方法可以实现下列功能:
源代码如下:
<% dim a(100)
a(1)=1
response.write("<form name=form1 method='post'>")
for I=m to n
response.write("<input name=cstr(a(i)) type=checkbox>")
.
.
.
.
next
response.write("</form>")
以上的代码只是我的思想的表达,主要功能是要完成在循环中把name存在数组中
若我的方法不行。各位大虾 有什么别的方法实现我的要求的,请告诉我,万分感谢

——一个菜鸟
...全文
235 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
tanyx 2001-03-29
  • 打赏
  • 举报
回复
在数据之前加一个字母!!!!!!!
cwhelucky 2001-03-29
  • 打赏
  • 举报
回复
如果是想把name值存在数组中那么你怎样知道访问的哪一个checkbox呢在知道其名字之前,我手上有好多好多源程序,如有需要,请说细说明你的需要,再和我联系
sxman 2001-03-29
  • 打赏
  • 举报
回复
不用数组,aa是字符,用来表示名字。
<%
response.write "<form name=form1 method='post'>"
for I=m to n
response.write "<input name=aa"&i&" type=checkbox>"
.
.
next
response.write "</form>"
%>
sxman 2001-03-29
  • 打赏
  • 举报
回复
简单
<% dim a(100)
a(1)=1
response.write "<form name=form1 method='post'>"
for I=m to n
response.write "<input name=aa"&i&" type=checkbox>"
.
.
next
response.write "</form>"
supersonics 2001-03-26
  • 打赏
  • 举报
回复
我想那是可以做到的。
但是我不明白你为什么要那样做?
wxylvmnn 2001-03-25
  • 打赏
  • 举报
回复
我也试过了,好象不行,还有没有别的方法?
farrio 2001-03-24
  • 打赏
  • 举报
回复
<form name form1 method=post>
<%for i=m to n%>
<input name="<%=a(i)%>" type=checkbox>
...
<%next%>
</form>
我没试过,不知道行不行。

28,406

社区成员

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

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