JavaScript Scripts





Español Français 中文 Deutsch Portuguese Japanese nederlands
   
 
Free Java Script Codes
Javascript List All
Slide Show Slide Show
Ad Display Ad Display
Image Effect Image Effect
Animated Image Effects Animated Image Effects
Form Validation Form Validation
Color Picker Tool Color Picker Tool
Formatting Forms Formatting Forms
Select All Select All
Dynamic Form Select Dynamic Form select
Dynamic Color Dynamic Color
Calendar Script Calendar
Textbox Counter Textbox Counter
Alphanumeric Alphanumeric
Date Time Script Date & Time
Stop Watch Script Stop Watch script
Delete Repeated Values Delete Repeated Values
Pagination Pagination
Random Generator Random Generator
Animated Text Animated Text
Cursor Position Cursor Position
User Info Window / User Info
Security Security / Authenticate
Bookmark Bookmark
Mouse Effects Mouse Effects
Title Bar Title Bar
Status Bar Status Bar
Country List Country List
Free Games Free Games
Calculators Calculators
 




Auto Select checkbox Script


About
 This Javascript is used to check/uncheck all items by a single click. Auto select or unselect all the items by simply clicking on check all / uncheck all Checkboxes. This script can be used for mutiple checkbox selections.


Features
a)This is a free javascript to auto select all checkboxes.
b)Click on check all checkbox to make multiple selection.
c)Click on uncheck all checkbox to deselect multiple selection.
d)Saves time as check/uncheck is performed by single selection.

Preview
Auto select checkboxes :
Item1
Item2
Item3
Item4
Check all
Uncheck all


Code
Javascript:
<!--        Script by hscripts.com          -->
<!--        copyright of HIOX INDIA         -->
<!-- more scripts @ http://www.hscripts.com -->
<script type="text/javascript">
function chksel()
{
  var tab = document.getElementById("div1")
  var chk = tab.getElementsByTagName("input");
  var num = chk.length;
  var x= document.getElementById("unchkbox");
  x.checked = false;
  for (var i = 0; i < num; i++)
  {  
   status = chk[i].getAttribute("type");
   if ( status == "checkbox") {    
             chk[i].checked = true;
   }
  }
}
function unchk()
{
  var tab = document.getElementById("div1")
  var chk = tab.getElementsByTagName("input");
  var num = chk.length;

 for (var i = 0; i < num; i++)
  {  
   status = chk[i].getAttribute("type");
   if ( status == "checkbox") {    
             chk[i].checked = false;
   }
}
}
</script>
<!-- Script By hscripts.com -- >


HTML Code:
<!-- Script by hscripts.com -->
<div id="div1">
<input type=checkbox>Item 1
<input type=checkbox>Item 2
<input type=checkbox>Item 3
<input type=checkbox>Item 4
<input type=checkbox onclick="chksel()">Check all
</div>
<div id="div2">
<input type=checkbox onclick="unchk()" id='unchkbox'>Uncheck all
</div>
<!-- Script by hscripts.com -->
Release Date - 20-08-2009
Get free version without ©copyright link for just 5 price

For customization of this script or any script development, contact us at support@hscripts.com


Usage
a) Copy the javascript code into <head> tag of your page.
b) Call the function chksel() which will act as a keystroke for selecting all other checkboxes.
for eg,
<input type=checkbox onclick="chksel()">Check all</input>
c) Use this auto select checkboxes script anywhere in your web page, where you need to check / uncheck all items.



License
- The javascript (misspelled as java script) is given under GPL License
- i.e. Free use for those who use the codes as it is.
- Free, if your modification does not remove our copyright information and links.
- Click Here for detailed license information.
- You can purchase the script if your requirements does not meet our GPL License terms.
Other Links

web hosting