Results 1 to 3 of 3

Thread: checkboxes

  1. #1
    Join Date
    Jun 2009
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default checkboxes

    Hi there,

    I would like to use the follwoing script for select all/ none buttons found in the archive of this forum. my problem is that my query will result in a list of checkboxes requiring me to using a div class for them

    only how could I get the below script to work for me then?

    Code:
    function checkAll() {
      var container;
      if (document.getElementById && (container = document.getElementById('cBoxes')) && container.getElementsByTagName) {
        var controls = container.getElementsByTagName('input');
          for (var i = 0, n = controls.length; i < n; ++i)
            if (controls[i].type == 'checkbox') 
              boxes[i].checked = true;
      }
    }
    
    function checkNone() {
      var container;
      if (document.getElementById && (container = document.getElementById('cBoxes')) && container.getElementsByTagName) {
        var controls = container.getElementsByTagName('input');
          for (var i = 0, n = controls.length; i < n; ++i)
            if (controls[i].type == 'checkbox') 
              boxes[i].checked = false;
      }
    }

  2. #2
    Join Date
    Dec 2008
    Location
    Portsmouth, UK
    Posts
    1,891
    Thanks
    2
    Thanked 441 Times in 435 Posts

    Default

    my problem is that my query will result in a list of checkboxes requiring me to using a div class for them
    please explain more fully and or provide sample HTML or link

  3. #3
    Join Date
    Jun 2009
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    thank you but I am using a different script now
    Last edited by cassy; 06-19-2009 at 02:41 PM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •