我是要做一个修改页面 ,要把表单提交上来的内容用一个循环来完成 ,我还没在循环中加修改只想先显示输出看一下 ,我先把request.form内容付给数组然后用数组循环,总提示我对象不是一个集合,
Dim myArray()
Redim myArray(11)
myarray(0)=request.form("mark")
myarray(1)=request.form("company")
myarray(2)=request.form("tickcode")
myarray(3)=request.form("start")
myarray(4)=request.form("end")
myarray(5)=request.form("time")
myarray(6)=request.form("voyage")
myarray(7)=request.form("level")
myarray(8)=request.form("pprice")
myarray(9)=request.form("discount")
myarray(10)=request.form("disceription")
for i=0 to 10
if myarray(i)<>"" then
rs.movefirst
就是这一句 for each j in myarray(i)
response.write j
next
rs.update
end if
next
---------------------------------------------------------------
你不如之前就把
request.form("mark")
request.form("company")
request.form("tickcode")
request.form("start")
request.form("end")
request.form("time")
request.form("voyage")
request.form("level")
request.form("pprice")
request.form("discount")
request.form("disceription")
这些用一个名字代替,也就是说把你所有的表单名字取为一个名
比如取为xxx
然后直接用
for each j in request("xxx")
response.write j
next
---------------------------------------------------------------
如果你提交上来的那些表单里有多值的话
for each j in myarray(i)
response.write j
next
可以改成:
for j=0 to myarray(i).length
response.write myarray(i)(j)
next
没有试过这样可不可行
不过这个绝对是可以的
for each names in request.from
for i=0 to request.form(names).length
response.write request.form(names)(j)
next
next