1<input type="checkbox" name="checkbox1" value="1">
2<input type="checkbox" name="checkbox1" value="2">
3<input type="checkbox" name="checkbox1" value="3">
4<input type="checkbox" name="checkbox1" value="4">
5<input type="checkbox" name="checkbox1" value="5">
6<input type="checkbox" name="checkbox1" value="6">
<form name="form1" method="post" action="">
<input name="textfield" type="text" value="显示在这里">
<input type="submit" name="Submit" value="提交">
<input type="button" name="button" value="获取另外没有在表单中的值" onclick="cc()">
<script language="JavaScript">
<!--
function cc()
{
  var str = "";
  var obj = document.getElementsByName("checkbox1");
  for(var i=0;i<obj.length;i++)
  {
    if(obj[i].checked == true)
{
   str += obj[i].value+",";
    }
  }
  str = str.substring(0,str.length-1);
  document.form1.textfield.value = str;
}
//-->
</script>