Posted By

walepinski on 07/08/06


Tagged

controller jquery checkbox


Versions (?)

Who likes this?

22 people have marked this snippet as a favorite

jonbaer
jkochis
damarev
Leech
hxseven
penguin999
bartekk
francisre
heinz1959
martingoldszein
korzhik
esquareda
loric
davidsi
alejandrosuch
seanpowell
tyfi84
prit
albertomori
espig
czachor
configuration


[ jQuery ] Checkbox Controller


 / Published in: JavaScript
 

Select all checkbox in the specific context. Need jQuery Framework : http://jquery.com/

  1. // context = id of elements which contains checkboxes
  2. // controller = DOMelement of ckeckbox controller
  3. function checkall(context, controller){
  4. $("#"+context).find("input[@type$='checkbox']").not(controller).each(function(){
  5. // verify the state of checkbox controller and pass the state to others checkboxes
  6. this.checked = $(controller).checked;
  7. });
  8. }

Report this snippet  

You need to login to post a comment.