asp添加无限的数据

<!--#include file="../../include/conn.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title></title>
<script language="javascript">
   function setid()
   {
   str='';
   if(!window.form1.upcount.value)
    window.form1.upcount.value=1;
    for(i=1;i<=window.form1.upcount.value;i++)
      str+='Color'+i+':&nbsp;&nbsp;&nbsp;<input type="text" name="color'+i+'">&nbsp;&nbsp;&nbsp;件数'+i+'&nbsp;&nbsp;&nbsp;<input type="text" name="num'+i+'">&nbsp;&nbsp;&nbsp;length'+i+'&nbsp;&nbsp;&nbsp;<input type="text" name="length'+i+'">&nbsp;&nbsp;&nbsp;size<input type="radio" name="size'+i+'" value="size_s">S <input name="size'+i+'" type="radio" value="size_m" checked>M<input type="radio" name="size'+i+'" value="size_l">L<input type="radio" name="size'+i+'" value="size_xl">XL<br>';
   window.upid.innerHTML=str+'<br>';
   }
   </script>
</head>

<body>
<form name="form1" method="post" action="add_ok.asp">
  <table width="100%"  border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td>offerNo:<input type="text" name="textfield"></td>
    </tr>
    <tr>
      <td>Brand:<input type="text" name="textfield2"></td>
    </tr>
    <tr>
      <td>Style:<input type="text" name="textfield3"></td>
    </tr>
    <tr>
      <td>颜色的种类个数:<input type="text" name="upcount" class="tx" value="1">
          <input type="button" name="Button" class="bt" οnclick="setid();" value="设定"></td>
    </tr>
    <tr>
      <td id="upid"></td>
    </tr>
     <tr>
      <td >
        <input type="submit" name="Submit" value="提交"></td>
    </tr>

  </table>
</form>
</body>
</html>

<!--#include file="../../include/conn.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title></title>
</head>

<body>
<%
upcount=Request.Form("upcount")

for i=1 to upcount

color=request.Form("color"&i)
num=request.Form("num"&i)
length=request.Form("length"&i)
size_s=request.Form("size"&i)
conn.execute("insert into W_store_color_size (color,"&size_s&",length) Values ('"&color&"',"&num&",'"&length&"')")

next
%>
</body>
</html>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值