欢迎光临
我们一直在努力

我以前做的,应该可以进精华区的–>记录多选框的选择次序

建站超值云服务器,限时71元/月

<html>
<head>
<title>untitled document</title>
<meta http-equiv="content-type" content="text/html; charset=gb2312">
</head>

<body bgcolor="#ffffff" text="#000000">
<table width=100% height=4% border=0 cellspacing=1 cellpadding=2 bordercolorlight=#000000 bordercolordark=#333333 align="center">
  <tr bgcolor="#cccccc">
    <td width="9%" height="7"   >
      <div align="center">选择</div>
    </td>
  </tr>
  <form method=post action="" name="post">
  

  <tr bgcolor="#cccccc">
    <td width="9%" height="12" >
      <input type="checkbox" value="1" onclick="putvalueto(this,1)" name="checkbox">
      <input type="checkbox" value="2" onclick="putvalueto(this,2)" name="checkbox">
      <input type="checkbox" value="3" onclick="putvalueto(this,3)" name="checkbox">
      <input type="checkbox" value="4" onclick="putvalueto(this,4)" name="checkbox">

      <input type="hidden" name="formsel" value="">
    </td>
  </tr>
  
</table></form>
</body>
</html>
<script>
  function putvalueto(y,x){
  var impitemid=;
  var ob_form1=document.post
  var ob_out=ob_form1.formsel
  var str_out="" + ob_out.value
    if (y.checked){       
       
        impitemid=x       
    }
   else {
        var str1=""+x
        var i_star=str_out.indexof(x)
        str_out=str_out.substr(0,(i_star-1))+str_out.substr((i_star+1))
        if (str_out.substr(0,1)==",")
            {str_out=str_out.substr(1)}
        if (str_out.substr((str_out.length-1))==",")
            {str_out=str_out.substr(0,str_out.length-1)}
        if (str_out.indexof(",,")>0)
            {var i1=str_out.indexof(",,")
             str_out=str_out.substr(0,i1-1)+str_out.substr(i1+1)
            
             }
        impitemid==
    }
    
    if (!impitemid==) {
    if (str_out==) {
     str_out=impitemid
    }
    else {
    str_out=str_out+,+impitemid
    }
    }
    ob_out.value=str_out
    alert (ob_form1.formsel.value);
  }

</script>

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » 我以前做的,应该可以进精华区的–>记录多选框的选择次序
分享到: 更多 (0)

相关推荐

  • 暂无文章