Check/toggle ‘em all

Recently I decided to clean up all the spam from an abandoned phpBB forum of mine, there was a lot to delete. In the phpBB version that I use there is no option to "check all" topics you want to moderate. So I came up with a little bookmarklet to do this for me. Here it is, only improved to work within frames and toggle (check if not checked, uncheck otherwise) all checkboxes in sight. Tested in FF and IE6/7.

To install, add this to your bookmarks/favourites:

Toggle 'em all

Here are
some
checkboxes
for
your
testing
pleasure.

The reading friendly code:

javascript:(function(){
function checkFrames(w) {

  try {
    var inputs = w.document.getElementsByTagName('input');
    for (var i = 0; i < inputs.length; i++) {
      if (inputs[i].type && inputs[i].type == 'checkbox'){
        inputs[i].checked = !inputs[i].checked;
      }
    }
  } catch (e){}
  if(w.frames && w.frames.length>0){

    for(var i = 0; i < w.frames.length;i++){
      var fr = w.frames[i];
      checkFrames(fr);
    }
  }
}
checkFrames(window);
})()

This entry was posted on Saturday, February 10th, 2007 and is filed under JavaScript, bookmarklets, phpBB. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.


Get notification for future posts: follow me on Twitter or subscribe to my RSS feed

Somewhat related posts

24 Responses to “Check/toggle ‘em all”

  1. unwiredbrain Says:

    Why don’t you provide a sort of test page?

  2. Stoyan Says:

    yes, good idea. I’ll add a few check boxes in this post.

  3. Paul Says:

    Thanks for this! Big help.

  4. Mike Says:

    Thanks!

  5. Gunther Says:

    Wow!… I needed this last night! It works! Kinda spooky!

  6. Toggle Em All Bookmarklet Makes Check Box Checking Comfortable Says:

    [...] install it simply go to the Toggle Em All website. You have the option to drag and drop the bookmarklet to the bookmark’s toolbar or to [...]

  7. Bookmarklet To Toggle All Checkboxes Says:

    [...] drag the bookmarklet from the Check/toggle ‘em all page to your browser bookmarks bar and click on it whenever you want to toggle between [...]

  8. Selecting / Toggle all check boxes in a click Says:

    [...] the Bookmark from here. Via [...]

  9. Toggle ‘Em All Makes Check Boxes Hassle Free [Bookmarklet] · TechBlogger Says:

    [...] without the bloat of extensions, make sure to check out our roundup of must handy bookmarklets. Toggle ‘Em All [via [...]

  10. Marc Says:

    Awesome, been looking for something like this for a while, to clean up an old guestregistration website. Thanks a bunch!

  11. McColley.net » Blog Archive » Toggle ‘Em All Makes Check Boxes Hassle Free [Bookmarklet] Says:

    [...] without the bloat of extensions, make sure to check out our roundup of must handy bookmarklets. Toggle ‘Em All [via [...]

  12. infoyourway.com » Toggle ‘Em All Makes Check Boxes Hassle Free [Bookmarklet] Says:

    [...] without the bloat of extensions, make sure to check out our roundup of must handy bookmarklets. Toggle ‘Em All [via [...]

  13. free Toggle ‘Em All Makes Check Boxes Hassle Free [Bookmarklet] | 82123 Says:

    [...] without the bloat of extensions, make sure to check out our roundup of must handy bookmarklets. Toggle ‘Em All [via [...]

  14. Toggle ‘Em All Makes Check Boxes Hassle Free [Bookmarklet] | Techno Portal Says:

    [...] without the bloat of extensions, make sure to check out our roundup of must handy bookmarklets. Toggle ‘Em All [via [...]

  15. Toggle ‘Em All Makes Check Boxes Hassle Free | Lifehacker Australia Says:

    [...] without the bloat of extensions, make sure to check out our roundup of must handy bookmarklets. Toggle ‘Em All [via gHacks] Tagged:bookmarkletstime [...]

  16. Toggle ‘Em All Makes Check Boxes Hassle Free [Bookmarklet] - 1443th Edition | Technology Revealed Says:

    [...] without the bloat of extensions, make sure to check out our roundup of must handy bookmarklets. Toggle ‘Em All [via [...]

  17. Toggle ‘Em All Makes Check Boxes Hassle Free [Bookmarklet] | Feed Reader Says:

    [...] without the bloat of extensions, make sure to check out our roundup of must handy bookmarklets. Toggle ‘Em All [via [...]

  18. links for 2009-04-20 « Amy G. Dala Says:

    [...] Check/toggle ‘em all / phpied.com [...]

  19. The Far Edge » Blog Archive » Toggle ‘Em All Makes Check Boxes Hassle Free [Bookmarklet] Says:

    [...] without the bloat of extensions, make sure to check out our roundup of must handy bookmarklets. Toggle ‘Em All [via [...]

  20. links for 2009-04-21 | Boost Ventilator Says:

    [...] Check/toggle ‘em all / phpied.com (tags: checkbox toggle javascript bookmarklet) This entry was posted in Boostmarks. Bookmark the permalink. Comments are closed, but you can leave a trackback: Trackback URL. « links for 2009-04-17 [...]

  21. lanux128 Says:

    cool bookmarklet, can this check/toggle function be included for user-selected area? (provided there are checkboxes within the selection)

  22. Lito | TheFilipinoEntrepreneur.Com Says:

    Thanks! that was very cooool! I didn’t know there were such kind of javascript. Thanks!

  23. MogBlog » Blog Archive » Bookmarklet to toggle all checkboxes on a webpage Says:

    [...] link Leave a Reply [...]

  24. Chris Says:

    This is an awesome feature. Much better than going through the hassle of installing an addon. Thanks :)

Leave a Reply