<script language="javascript"> 
function check(){ 
var strchoice=""; 
for(var i=0;i<document.info.choice.length;i++){ 
if (document.info.choice[i].checked) { 
strchoice=strchoice+document.info.choice[i].value+","; 

}  if (!document.info.choice.length) { 
if (document.info.choice.checked) { 
strchoice=document.info.choice[i].value;+"," 

}

strchoice=strchoice.substring(0,strchoice.length-1); 
document.info.choiceid.value=strchoice; 
alert(document.info.choiceall.value); 

</script> 
用这个把,那获得全部的值

解决方案 »

  1.   

    <form name="form1" method="post" action="bb.asp">
          <input type="checkbox" name="checkbox[]" value="123">
          123
          <input type="checkbox" name="checkbox[]" value="234">
          234
          <input type="checkbox" name="checkbox[]" value="asd">
          asd
          <input type="checkbox" name="checkbox[]" value="qwe">
          qwe
      <input name="" type="submit">
        </form>
    <?print_r($checkbox);?>
      

  2.   

    info 是form name=info
    <input type=\"hidden\" name=\"choiceid\"><input type=submit value=\"获得\">
    choice是checkbox name=choice
      

  3.   

    唠叨的方法最简单,复选框名称用 checkboxname[],取值的时候用 
    $_POST['checkboxname'],这是一个数组,checkboxname的值就存在于这个数组中,第一个就是 $_POST['checkboxname'][0],以此类推
      

  4.   

    补充一下,你选的值才能进入这个数组,没有选的是不会被post或者get过来的
      

  5.   

    你的checkbox中name 只有一个所以只能传一个了。
      

  6.   

    注意!
    这不是我的方法,这是php的约定。
    php对表单变量命名时有一个小小的要求:同名的表单变量要写成数组形式,否则他不认得。
      

  7.   

    前台表单多选框命名为checkbox[],主要是的是后面的一对中括号js访问该表单元素产生歧义的解决办法
    http://www.blueidea.com/bbs/NewsDetail.asp?id=1256952
    ===================================================
    后台读取选中的值
    print_r($_POST['checkbox'])将其保存为asp的多选框格式
    echo implode(",",$_POST['checkbox'])
      

  8.   

    xuzuning(唠叨)是偶的偶像,偶同意她的看法