¶ÁÊéÈË

Ϊʲôcheckboxȫѡ²»ÄÜÑ¡ÖÐÖ»ÏëÑ¡ÖÐ

·¢²¼Ê±¼ä£º 2012-11-21 08:23:26 ×÷Õߣº rapoo

Ϊʲôcheckboxȫѡ²»ÄÜÑ¡ÖУ¬Ö»ÏëÑ¡ÖÐÆäÖÐÒ»ÁеÄcheckbox£¿´úÂëÈçÏ¡£
ÎÒÏëʵÏÖµ¥»÷¡°²½ÖèÑ¡Ôñ£¨È«Ñ¡£©¡±µÄ¸´Ñ¡¿òÑ¡ÖÐÑ¡ÖиÃÁеÄcheckbox£¬Ôٴε¥»÷È¡Ïûȫѡ£¬ÁíÍâÒ»ÁеÄcheckbox²»ÒªÓÐÓ°Ïì¡£Çë·¹ýµÄ´óÏÀ°ï濴һϡ£·Ç³£¸Ðл¡£

JScript code
<script type="text/javascript">     function CheckAll(form1) {         for (var i = 0; i < form1.elements.length; i++) {             var e = form1.element[i];             if (e.Name == 'chk1' && e.disabled == false)                 e.checked = form1.chkAll.checked;         }     }     function unselectall() {         if (document.myform.chkAll.checked) {             document.myform.chkAll.checked = document.myform.chkAll.checked & 0;         }     }     alert("test");    </script> 

HTML code
 <table id="flowtbl" datasrc="#dso2" >                                 <thead>                                     <th align="left" width="152px">                                         <input align="left" name="chkAll" type="checkbox"  onclick="CheckAll(this.form) "                                              />                                         ²½ÖèÑ¡Ôñ£¨È«Ñ¡£©                                     </th>                                     <th align="left">                                         ²½Öè±àºÅ                                     </th>                                     <th align="left">                                         ²½ÖèÃû³Æ                                     </th>                                     <th align="left">                                         ÊÇ·ñÉóÅú                                     </th>                                 </thead>                                 <tr>                                     <td  class="style4">                                         <input type="checkbox" class="chk1" value="11" />                                     </td>                                     <td  class="style4">                                         <span datafld="ID"></span>                                     </td>                                     <td  width="312px">                                         <span datafld="name"></span>                                     </td>                                     <td  >                                         <input   type="checkbox" class="chk" /><input   type="text" />                                     </td>                                 </tr> <tr>                                      <td  class="style4">                                          <input type="checkbox" class="chk1" value="11" />                                      </td>                                      <td  class="style4">                                          <span datafld="ID"></span>                                      </td>                                      <td  width="312px">                                          <span datafld="name"></span>                                      </td>                                      <td  >                                          <input   type="checkbox" class="chk" /><input   type="text" />                                      </td>                                  </tr>                             </table> 



[½â¾ö°ì·¨]
ÎÒÔõôû¿´µ½ÓÐ e.Name == 'chk1'

¶ÁÊéÈËÍø >asp.net

ÈȵãÍÆ¼ö