<input type="checkbox" name="checkbox<%=cnt_check%>" value=<%=Row[0]%> ></td>这是页面里
我怎么也不能得到这些值了怎么办,
必须在页面中,就串起来,

解决方案 »

  1.   

    function goto_total(bbmb,bmid,cnt_check)
    {
    var tepcheckvalue = ""; // document.form_total.bbmb.value=bbmb;
    // document.form_total.bmid.value=bmid;
    i=0;
    document.form_total.bblist.value="";
    for(i=0;i<cnt_check;i++)
    {
     tempcheck = document.all('checkbox' + i) ;

    if(tempcheck.checked==true)
    {


    tepcheckvalue = tepcheckvalue+"@"+tempcheck.value;

    }

    }
    alert(tepcheckvalue);
    document.form_total.bblist.value = tepcheckvalue;

    document.form_total.target="_blank";
    document.form_total.action="submitReportForAccount.jsp";
    document.form_total.submit();
    return;
    }
      

  2.   

    得那个对象时不能简单的将字符串相加,最好在组合字符串之后用eval()去取,
    tempcheck = eval(checkbox + i);
    这样应该就可以了。
      

  3.   

    checkbox和radio一样,将name设为相同才能发挥其最大用处
    var c=document.form1.chbox
    for(i=0;i<c.length;i++)
    ...要不可以用
    var c=document.getElementsByTagName("input")
    for(i=0;i<c.length;i++)
    if(c.type=="checkbox")
    ...
      

  4.   

    checkbox和radio一样,将name设为相同才能发挥其最大用处
    var c=document.form1.chbox
    for(i=0;i<c.length;i++)
    ...我K,还有这个用法,我原来也是,设为相同的名字,但只是用来向后台传,这回要在页面上,学习ing
      

  5.   

    function goto_total(bbmb,bmid,cnt_check)
    {
    var tepcheckvalue = ""; // document.form_total.bbmb.value=bbmb;
    // document.form_total.bmid.value=bmid;
         var c=document.form_total.checkbox ;
         for(i=0;i<c.length;i++) {
    // tempcheck = document.all('checkbox' + i)
    //  tempcheck = eval(document.form_total.checkbox + i );
     //alert(i + tempcheck ) ;
    // if(c.checked==true)
    // {
    // alert(i + tempcheck ) ;

    tepcheckvalue = tepcheckvalue+"@"+c.value;

    // }

    }
    alert(tepcheckvalue);
    没好使,
    怎么回事??
      

  6.   

    是个数组
    <script language="JavaScript">
    <!--
    function s(){
    var str=""
    var c=document.frm.a
    for(i=0;i<c.length;i++)
    if(c[i].checked)str+=c[i].value
    alert(str)
    }
    //-->
    </script>
    <form name=frm>
    <input type="checkbox" name="a" value="是">
    <input type="checkbox" name="a" value="这">
    <input type="checkbox" name="a" value="样">
    <input type=submit onclick="s()">
    </form>