Full version: jsB@nk » Form » Checkbox » Check All Toggle Switch
URL: https://www.javascriptbank.com/check-all-toggle-switch.html
This script adds the 'check all' function to a form. Short and easy to use.
Full version: jsB@nk » Form » Checkbox » Check All Toggle Switch
URL: https://www.javascriptbank.com/check-all-toggle-switch.html
<script type="text/javascript">// Created by: Hillel Aftel :: equazcion (at) gmail.comfunction checkAll(checkname, exby) { for (i = 0; i < checkname.length; i++) checkname[i].checked = exby.checked? true:false}// --></script><!-- This script downloaded from www.JavaScriptBank.com Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->
<form name="mylist" style="text-align: left; width: 50%;"> <input type="checkbox" name="checkGroup" value ="first">First<br> <input type="checkbox" name="checkGroup" value ="second">Second<br> <input type="checkbox" name="checkGroup" value ="third">Third<br> <input type="checkbox" name="checkGroup" value ="fourth">Fourth<br> <input type="checkbox" name="all" onClick="checkAll(document.mylist.checkGroup,this)">Check/Uncheck All<br></form><!-- This script downloaded from www.JavaScriptBank.com Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->