[求助]选择相加
											字段AA 字段1=25元
字段a1=50元     对字段   复选框
字段a2=50元     对字段   复选框    我选择这个
字段a3=50元     对字段   复选框    我选择这个
字段a4=50元     对字段   复选框
字段a5=50元     对字段   复选框
现在把  字段AA=字段a2+字段a3+字段1
怎么样写这个代码
字段AA 字段1=25元
字段a1=50元     对字段   复选框
字段a2=50元     对字段   复选框    我选择这个
字段a3=50元     对字段   复选框    我选择这个
字段a4=50元     对字段   复选框
字段a5=50元     对字段   复选框
现在把  字段AA=字段a2+字段a3+字段1
怎么样写这个代码
 2006-08-07 23:53
	    2006-08-07 23:53
  [此贴子已经被作者于2006-8-8 0:12:50编辑过]
 2006-08-08 00:12
	    2006-08-08 00:12
   2006-08-08 12:10
	    2006-08-08 12:10
  2楼说的很明白了  你可以自己试一下
先把所有的复选框起相同的名字,并且都赋上不同的值
象这样<input type = "checkbox" name = "checkbox1" value = "1">check1
      <input type = "checkbox" name = "checkbox1" value = "2">check2
      <input type = "checkbox" name = "checkbox1" value = "3">check3
然后提交表单,在下一页写上
    result = request.form("checkbox1")
    response.write result
结果应该是    1,2,3
再用split(result,",")把上边得到的字符串分割成一个数组
result = split(result,",")
for i = 0 to ubound(result)
    sum = sum + cint(result(i))
next
response.write "<p>"&sum
就OK了 去试试看吧

 2006-08-08 13:17
	    2006-08-08 13:17
   2006-08-08 17:56
	    2006-08-08 17:56
   2006-08-08 20:53
	    2006-08-08 20:53