循环取值和循环文本框显示问题
要实现的功能是根据用户预约的套餐,循环显示,如根据男女选择不同,显示数字不同,并跟据数量计算总值,然后根据多选框计算多选框的总值,这样一个循环做了多次都不行,所以只能到这里来求救了,分不多,希望高手帮忙。源代码如下:<%dim dbpath
dbpath=""
%>
<!--#include file="Conn.asp"-->
<%dim nowplace
nowplace="add_order"
%>
<!--#include file="User_Chk.asp"-->
<script language="javascript">
function add_sel1()
{
var OID_Str="";
for(var i=0;i<document.all.length;i++)
{
if(document.all[i].type=='checkbox')
{
if(document.all[i].checked==true)
{
OID_Str=OID_Str-document.all[i].value;
}
}
}
document.all["htmlOID_Sel"].value=-(OID_Str);
}
function raclick(RadioAry,Idx)
{
for(var i=0;i<RadioAry.length;i++)
{
if(RadioAry[i].checked)
{
if(document.form1.tx.length!=null)
document.form1.tx[Idx].value=RadioAry[i].value;
else
document.form1.tx.value==RadioAry[i].value;
}
}
}
function raclic()
{
var tx=document.all.tx.value;
var ff=document.all.ff.value;
var c=tx*ff;
document.all.tx1.value=c;
}
</script>
<!--#include file="include/MyRequest.asp" -->
<!--#include file="include/nosql.asp" -->
<!--#include file=Sub.asp -->
<%ProdIds = Session("ProdIds")
ProdNums = Session("ProdNums")
Sum = Session("sum")
sum=FormatNumber(sum,2,-1)
sum=cint(sum)
call up("预约中心","预约中心","<a href=cart_list.asp>预约项目</a> » 预约")
response.write" <form name=form1 action=Cart_OrderSave.asp method=post onsubmit=return check_form();>"&_
"<tr><td>"&_
" <table border=1 width=100% cellpadding=4 style='border-collapse: collapse' bordercolor=#DFDFDF>"&_
" <tr><td>套餐名称</td><td colspan=2 align=center>预约性别</td><td colspan=3 align=center>价格</td><td align=center colspan=3>预约数量</td></tr>"
if ProdIds<>"" then
aaa=split(ProdNums,",")
bbb=split(ProdIds,",")
for i=0 to ubound(bbb)
set rs=server.createobject("adodb.recordset")
sql="select id,product_info_PriceM,product_info_PriceS,product_info_name from taocai where id="&bbb(i)
rs.open sql,conn,1,1
if rs.eof then
response.write "<tr><td colspan=5 align=center><a href=index.asp>预约项目为空,请返回选购套餐</a></td></tr>"&_
"</table>"
response.end
else
set id=rs(0)
set product_info_pricem=rs(1)
set product_info_prices=rs(2)
set product_info_name=rs(3)
response.write " <tr>"&_
" <td><a href=taocai_Detail.asp?id="&id&" target=_blank>"&product_info_name&"</a></td>"&_
"<td colspan=2 align=center>"
response.write "<input type=radio value="&product_info_pricem&" name=order_info_nannv"&i&" onclick=raclick(document.form1.order_info_nannv"&i&",'"&i&"')>男 "&_
"<input type=radio value="&product_info_prices&" name=order_info_nannv"&i&" onclick=raclick(document.form1.order_info_nannv"&i&",'"&i&"') >女</td>"
While Not rs.EOF
x=aaa(i)
if aaa(i)="" then x=1
sum1=sum1 + csng(rmb) * x
sum=FormatNumber(sum1,2,-1)
response.write" <td colspan=3 align=center><input type=text name=tx size=5>元</td>"&_
" <td align=center colspan=3><input id='ff' type='text' value="&x&" onkeyup=raclic()> </td></tr><tr><td>可选项目</td>"
Set rs9= Server.CreateObject("ADODB.Recordset")
sql9="select product_name,Product_Price from fujia"
rs9.open sql9,conn,1,1
if rs9.eof then
response.write "目前暂无可选项目信息!"
else
rs9.PageSize =10 '每页记录条数
iCount9=rs9.RecordCount '记录总数
iPageSize9=rs9.PageSize
maxpage9=rs9.PageCount
page9=request("page")
if Not IsNumeric(page9) or page9="" then
page9=1
else
page9=cint(page9)
end if
if page9<1 then
page9=1
elseif page9>maxpage9 then
page9=maxpage9
end if
rs9.AbsolutePage=Page9
if page9=maxpage9 then
x9=iCount9-(maxpage9-1)*iPageSize9
else
x9=iPageSize9
end if
i9=1
while not rs9.eof and i9<=rs9.pagesize
Product_name = rs9(0)
Product_Price = rs9(1)
response.write"<td align=center><font color=#ff3300></font><input id=OID_Sel name=fuxuan"&i&" type='checkbox' value='"&product_price&"' onclick=add_sel1()>"&product_name&"<br/>("&product_price&")</td>"
%>
<% rs9.movenext
i9=i9+1
wend
end if
rs9.close
set rs9=nothing
response.write" </tr>"&_
"<td>小计:</td><td colspan=8>套餐:<input type='text' name=tx1 size=5> 可选项:<input type='text' id='htmlOID_Sel' value='' name=kexuan size=70></td>"
rs.MoveNext
Wend
end if
rs.close
set rs=nothing
next
else
response.write "<tr><td colspan=5 align=center><a href=index.asp>预约项目为空,请返回选购套餐!</a></td></tr>"
end if
response.write " <tr><td> </td><td><input class=button type=submit value= 提交预约 ></td></tr>"&_
" </table>" &_
"</td></tr>"&_
" </form>"
call down()
%>