| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 431 人关注过本帖
标题:求助:头疼的循环取值问题
只看楼主 加入收藏
jyeiw
Rank: 1
来 自:无锡
等 级:新手上路
帖 子:13
专家分:1
注 册:2009-9-13
结帖率:0
收藏
 问题点数:0 回复次数:1 
求助:头疼的循环取值问题
令人头疼的循环取值问题,当只有一个时,代码有效,两个以上就没用了,高手帮忙下,(要实现的意思:循环中,有个男女的单选框,控制后面的一个价格文本框,和总价的文本框,还有多个复选框,控制后面总价)代码如下:
<%dim dbpath
dbpath=""
%>
<!--#include file="Conn.asp"-->
<%dim nowplace
nowplace="add_order"
Set rs=Server.CreateObject("ADODB.Recordset")
sql="select root_option_GuestOrderOnOff from root_option where id=1"
rs.open sql,conn,1,1
root_option_GuestOrderOnOff=rs(0)
rs.close
set rs=nothing
if root_option_GuestOrderOnOff=1 then
%>
<!--#include file="User_Chk.asp"-->
<%
end if
%>
<!--#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)

//会员信息调出
Set rs= Server.CreateObject("ADODB.Recordset")
sql="select user_info_RealName,user_info_mobile,user_info_tel,user_info_address,user_info_zip,user_info_email from user_info where user_info_id="&session("user_info_id")
rs.open sql,conn,1,1
user_info_RealName=rs(0)
user_info_mobile  =rs(1)
user_info_tel     =rs(2)
user_info_address =rs(3)
user_info_zip     =rs(4)
user_info_email   =rs(5)
rs.close
set rs=nothing

call up("预约中心","预约中心","<a href=cart_list.asp>预约项目</a> &raquo; 预约")
    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><input type=radio value="&product_info_pricem&" name=order_info_nannv"&id&" onclick=raclick(this.value)&raclic()>男&nbsp;&nbsp;"&_   
            "<input type=radio value="&product_info_prices&" name=order_info_nannv"&id&" onclick=raclick(this.value)&raclic(this.value)>女</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"&id&" type='checkbox' value='"&product_price&"' onclick=add_sel1()>"&product_name&"<br/>("&product_price&")</td>"
%>
  <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);   
  }   
      </script>            
                <% 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>&nbsp;&nbsp;可选项:<input type='text' id='htmlOID_Sel' value='' name=kexuan size=70></td>"
                                %>
<script>
function raclick(value){
document.all.tx.value =value
}
</script>
<script type="text/javascript">
function raclic()
{
var tx=document.all.tx.value;
var ff=document.all.ff.value;
var c=tx*ff;
document.all.tx1.value=c;
}
</script>
 
<%
                                    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  "        </table>"&_
                "        <br>"&_
                "        <table border=0 width=100% cellpadding=4 style=border-collapse: collapse>"&_            
                "            <tr><td colspan=2><b>预约人信息</b></td></tr>"&_
                "            <tr><td>姓名:    </td><td><input type=text name=Order_info_RealName size=30 value="&User_info_RealName&"></td></tr>"&_
                "            <tr><td>电子邮件:</td><td><input type=text name=order_info_email size=30 value="&User_info_email&">(注意电子邮件必须含@)</td></tr>"&_
                "            <tr><td>地址:</td><td><input type=text name=order_info_address size=50 value="&User_info_address&"> </td></tr>"&_
                "            <tr><td>邮政编码:</td><td><input type=text name=order_info_zip size=30 value="&User_info_zip&">(注意邮编必须是6位数字)</td></tr>"&_
                "            <tr><td>联系电话:</td><td><input type=text name=order_info_tel size=30 value="&User_info_tel&"></td></tr>"&_
                "            <tr><td>移动电话:</td><td><input type=text name=order_info_mobile size=30 value="&User_info_mobile&">(注意手机号码的位置必须是11位数字)</td></tr>"&_
                "            <tr><td></td><td><input type=checkbox name=order_info_up value=1>用上述联系方法覆盖帐户信息</td></tr>"&_
"<tr><td>客户留言:</td><td><textarea rows=3 name=order_info_BuyNote cols=50></textarea>&nbsp;请填写您预约的时间和其他说明</td></tr>"&_
        "            <tr><td> </td><td><input class=button type=submit value=  提交预约   ></td></tr>"&_
"            <tr><td colspan=2></td></tr>"&_            
                "        </table>" &_  
                "</td></tr>"&_
                "        </form>"
call down()
%>

[ 本帖最后由 jyeiw 于 2009-9-13 21:37 编辑 ]
搜索更多相关主题的帖子: 头疼 
2009-09-13 13:03
jyeiw
Rank: 1
来 自:无锡
等 级:新手上路
帖 子:13
专家分:1
注 册:2009-9-13
收藏
得分:0 
高手帮忙啊,救命
2009-09-22 18:32
快速回复:求助:头疼的循环取值问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.026966 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved