Grant Bristow wrote:
> I'm BRAND new to jQuery.  I've successfully (and easily) selected all 
> of the checked checkboxes, but now, I would like to check (or uncheck) 
> them.  Could someone show me how this is done?  Thanks in advance.
>  
> ----
> Grant

Hi Grant,

I posted this a week or so back but I don't think it made the list due 
to server issues.

I hope it helps you.

Gurus, comments and improvements please!

Regards to All

Rob


Code:

$.radioCheckboxGroup = function(element) {

   var x= $('[EMAIL PROTECTED]' + element + ']');

   x.click(function() {

       x.each(function() {

           this.checked = false;
       });

       this.checked = true;
   });

}

$.selectDeselectAll = function(ctrl,element) {

   $('[EMAIL PROTECTED]' + ctrl + ']').click(function() {

       var x = this.checked;

       $('[EMAIL PROTECTED]' + element + ']').each(function() {

           this.checked = x;
       });
   });

}

Usage:

$(document).ready(function() {

   $.radioCheckboxGroup('stuff');

   $.selectDeselectAll('removeAll','remove[]');

});



_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to