主题:  怎么没人回复!

水中的石子

职务:普通成员
等级:1
金币:0.0
发贴:17
注册:2002/3/9 19:33:53
#12002/3/22 19:14:22
我想实现repeat中,通过调用循环量,改变表单中元素的名称,如checkbox1,checkbox2,checkbox3等
格式应该如何写?
我试了
还有" value="1">
(session("checkid")="check" & Repeat1__index)
都没有实现。
我是想调用数据库的表,并通过循环语句实现一次添加多条记录
循环语句已经搞定了,可出现了以上的难题。
这个问题已困扰我好久了。希望高手帮忙!

编辑历史:[这消息被水中的石子编辑过(编辑时间2002-03-22 19:29:02)]
[这消息被水中的石子编辑过(编辑时间2002-03-24 10:25:32)]


5D荣誉斑竹

职务:普通成员
等级:3
金币:10.0
发贴:1480
注册:2002/1/15 11:01:54
#22002/3/22 21:01:29
看了你的几个方法,应该是可以的.其中这个比较合理.


是不是其他代码的问题?都帖出来看看.



水中的石子

职务:普通成员
等级:1
金币:0.0
发贴:17
注册:2002/3/9 19:33:53
#32002/3/22 21:34:39
谢谢你的回复,现将主要代码贴到下面
<%
if request("submit")<>"" then
for i=0 to 3 (目前只有4条记录,故只循环到3)
if request("checkbox" & i)=1 then
Recordset1.addnew
Recordset1("xuhao")=request("xuhao" & i)
Recordset1("pingming")=request("pingming" & i)
Recordset1.update
end if
next
response.redirect "yaodan.asp"
end if
%>


Untitled Document




<%
session("shenqingren")=request.form("shenqingren")
%>

 申请组室:<%=session("zushi")%> 申请人:<%=session("shenqingren")%> 申请时间:<%=date()%>











<%
While ((Repeat1__numRows <> 0) AND (NOT Recordset1.EOF))
%>








<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
session("checkid")="checkbox" & Repeat1__index
session("xuhaoid")="xuhao" & Repeat1__index
session("pingmingid")="pingming" & Repeat1__index
Recordset1.MoveNext()
Wend
%>
序号 品名 规格 单位  

" value="1">(其中"<%=session("checked")%>"可换成"checkbox" & Repeat1__index,其它的类似)

" value="<%=(Recordset1.Fields.Item("xuhao").value)%>">
" value="<%=(Recordset1.Fields.Item("pingming").value)%>">
<%=(Recordset1.Fields.Item("xuhao").value)%>
" target="_blank"><%=(Recordset1.Fields.Item("pingming").value)%> <%=(Recordset1.Fields.Item("guige").value)%> <%=(Recordset1.Fields.Item("danwei").value)%> " target="_blank">加入药单



 






Text

编辑历史:[这消息被水中的石子编辑过(编辑时间2002-03-22 21:37:18)]
[这消息被水中的石子编辑过(编辑时间2002-03-22 21:44:20)]
[这消息被水中的石子编辑过(编辑时间2002-03-22 21:45:30)]
[这消息被水中的石子编辑过(编辑时间2002-03-22 21:48:38)]


5D荣誉斑竹

职务:普通成员
等级:3
金币:10.0
发贴:1480
注册:2002/1/15 11:01:54
#42002/3/22 22:31:23
UD做的啊!

受不了...



水中的石子

职务:普通成员
等级:1
金币:0.0
发贴:17
注册:2002/3/9 19:33:53
#52002/3/23 9:27:24
是呀,因为此页面也有其它内容,所以看起来很烦,我就将主要内容再贴一次吧
循环段:(在前)
<%
if request("submit")<>"" then
for i=0 to 3
if request("checkbox" & i)=1 then
Recordset1.addnew
Recordset1("xuhao")=request("xuhao" & i)
Recordset1("pingming")=request("pingming" & i)
Recordset1.update
end if
next
response.redirect "yaodan.asp"
end if
%>
命名段:
<%
While ((Repeat1__numRows <> 0) AND (NOT Recordset1.EOF))
%>


" value="1">
" value="<%=(Recordset1.Fields.Item("xuhao").value)%>">
" value="<%=(Recordset1.Fields.Item("pingming").value)%>">



<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
session("checkid")="check" & Repeat1__index
session("xuhaoid")="xuhao" & Repeat1__index
session("pingmingid")="pingming" & Repeat1__index
Recordset1.MoveNext()
Wend
%>
主要的就这些,麻烦高手了