Results 1 to 4 of 4

Thread: check all checkboxes...

  1. #1

    Thread Starter
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091

    Talking check all checkboxes...

    Can somebody show me how to check all checkboxes in a form with JavaScript? Like in Hotmail, you've got that "Check All" checkbox at the top of the Inbox.

    Thanks

    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  2. #2
    From our very own John Percival :
    Code:
    function CheckAll() {
    	for (var i=0;i<document.form.elements.length;i++) {
    		var e = document.form.elements[i];
    		if ((e.name != 'allbox') && (e.type=='checkbox')) {
    			e.checked = document.form.allbox.checked;
    		}
    	}
    }
    Of course you have to name your INPUT fields appropriately.

  3. #3

    Thread Starter
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    Thanks Arien, I take back all but 4 bad things I've said about you. (I need to keep some in reserve)

    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  4. #4
    Thanks, I guess.

Posting Permissions

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



Click Here to Expand Forum to Full Width