Today I will show an script that is really useful to work with Checkbox, at least to me 😉
Script Name: jsCheckBox
Version: 0.1
License: GPL v3
Screenshot:
Usage:
This first one select/unselect all the checbox from a form.
function checkUncheckAll(theElement) {
var theForm = theElement.form, z = 0;
for(z=0; z
Usage:
It will select the next checkboxes
This one is a bit more complex, we say the controlbox from where we copy the state (selected or not), and the containers for other checkboxes.
function checkUncheckSome(controller,theElements) {
var formElements = theElements.split(',');
var theController = document.getElementById(controller);
for(var z=0; z
Usage:
Sample 1: We will check all the checkboxes from the div 1
Sample 2: Only will check the div1 and div3, not the div2.
Support: forum.neo22s.com
Notes:
Works in FF 3.5, Chromium, Opera 10, ie6