js checkbox演示

< 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 >
 

你可能感兴趣的:(js,职场,休闲,checkbox演示)