»
AnglaisFran�aisVietnamien

Imprimer - Cocher/Décocher tous - JavaScriptBank.com

Version compl�te: jsB@nk » Form » Checkbox » Cocher/Décocher tous
URL: https://www.javascriptbank.com/check-uncheck-all.html

Cocher/Décocher tous © JavaScriptBank.comDynamique de contrôle et décoche toutes les cases dans un forme quand un checkbox est cliqué. Beaucoup plus facile que manuellement le codage en dur checkbox les noms, bien sûr.

Version compl�te: jsB@nk » Form » Checkbox » Cocher/Décocher tous
URL: https://www.javascriptbank.com/check-uncheck-all.html



JavaScript
<SCRIPT language=javascript>var ie;if (document.all)ie = true;elseie = false;function _ca(obj)  {  var Count = 11; // number of checkboxes    for(var ii=1;ii<=Count;ii++)    {if (ie)  {  box = document.all["d"+ii];  box.checked = obj.checked;  }else  {  box = document.getElementsByName("d"+ii);  box[0].checked = obj.checked;  }}  }</SCRIPT><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


HTML
<P><INPUT onclick="javascript: _ca(this);" type=checkbox value=checkbox name=checkbox> &nbsp;Check/UnCheck All</P><P><INPUT type=checkbox value=checkbox name=d1> Item 1<BR><INPUT type=checkbox value=checkbox name=d2> Item 2<BR><INPUT type=checkbox value=checkbox name=d3> Item 3<BR><INPUT type=checkbox value=checkbox name=d4> Item 4<BR><INPUT type=checkbox value=checkbox name=d5> Item 5<BR><INPUT type=checkbox value=checkbox name=d6> Item 6<BR><INPUT type=checkbox value=checkbox name=d7> Item 7<BR><INPUT type=checkbox value=checkbox name=d8> Item 8<BR><INPUT type=checkbox value=checkbox name=d9> Item 9<BR><INPUT type=checkbox value=checkbox name=d10> Item 10<BR><INPUT type=checkbox value=checkbox name=d11> Item 11<BR></P><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->