注册 | 登录 忘记密码? 51cto首页 | 博客 | 论坛 | 招聘
热点文章 利用手机和电池实现反地心..
 帮助

js checkbox演示


2008-02-19 10:51:01
 标签:js checkbox演示   [推送到技术圈]

版权声明:原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 、作者信息和本声明。否则将追究法律责任。http://maomao.blog.51cto.com/115985/62403
<html>
    <head>
       <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
       <title></title>
       <script type="text/javascript">
function form_Attachment()
{
    var form_attachments="";
   
    var list=document.getElementsByTagName("input");
    for(var i=0;i<list.length;i++)
    {
       if(list[i].type=="checkbox")
       {
           if(list[i].checked==false)
           {
              form_attachments+=list[i].value+",";
           }
       }
 
    }
    var sequnce_id=form_attachments.substring(0,form_attachments.length-1);
    document.getElementById("sequence").value=sequnce_id;
 
}
</script>
    </head>
    <body>
       <form id="form1" name="form1" method="post">
           <p>
              <input type="text" id="sequence" name="sequence" />
              <input type="checkbox" name="checkbox" value="1" />
              <input type="checkbox" name="checkbox" value="2" />
              <input name="checkbox" type="checkbox" value="3" />
              <input type="checkbox" name="checkbox" value="4" />
              <input type="checkbox" name="checkbox" value="5" />
              <input type="checkbox" name="checkbox" value="6" />
           </p>
           <input type="button" name="Submit" value="提交"
              onclick="form_Attachment();" />
           </p>
       </form>
    </body>
</html>
 

本文出自 “maomao” 博客,请务必保留此出处http://maomao.blog.51cto.com/115985/62403





    文章评论
 
2008-02-19 11:19:51
咋没个文字讲解啥的

 

发表评论

昵   称:
验证码:  点击图片可刷新验证码  博客过2级,无需填写验证码
内   容: