无法检查for循环中的复选框

时间:2013-01-08 12:20:54

标签: javascript html

  1. 我正在尝试检查内部的复选框for循环,代码
        <div id="div_filterctrl_<?php echo $row['id'];?>"
    class="jfmfs-friend gmail" onclick="javascript: togglediv(this,'filterctrl_<?php echo $row['id'];?>');"> <span class="ggl-icn"></span> <img alt="User Picture" class="pro-pic" src="<?php echo $imageurl;?>" border="0" height="40" width="50">
    <div class="friend-name"> <?php echo $name;?> </div> <span style="display: none;"> <input name="allcontact[]" id="filterctrl_<?php echo $row['id'];?>" class="email_invited" value="<?php echo $row['id'];?>" type="checkbox" /> </span> </div>

  2. 现在我正在使用我的javascript检查复选框,我的代码是,

       function selectall()    {
          <?php     
       foreach ($this->arrcontacts as $res)     
       {     ?>
          document.getElementById("filterctrl_<?php echo $res['id'];?>").checked = true;               <?          }    ?>   } 
    

    但这并非全部有效。任何人都可以告诉我,扫管笏是错的。

0 个答案:

没有答案
相关问题