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:
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 bookmarklets, JavaScript, 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

August 1st, 2007 at 10:40 am
Why don’t you provide a sort of test page?
August 1st, 2007 at 11:27 am
yes, good idea. I’ll add a few check boxes in this post.
August 9th, 2007 at 1:35 pm
Thanks for this! Big help.
October 22nd, 2007 at 8:21 pm
Thanks!
March 1st, 2008 at 10:49 pm
Wow!… I needed this last night! It works! Kinda spooky!
April 18th, 2009 at 3:07 am
[...] 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 [...]
April 18th, 2009 at 10:57 am
[...] 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 [...]
April 19th, 2009 at 12:02 am
[...] the Bookmark from here. Via [...]
April 19th, 2009 at 10:19 am
[...] without the bloat of extensions, make sure to check out our roundup of must handy bookmarklets. Toggle ‘Em All [via [...]
April 19th, 2009 at 10:21 am
Awesome, been looking for something like this for a while, to clean up an old guestregistration website. Thanks a bunch!
April 19th, 2009 at 10:30 am
[...] without the bloat of extensions, make sure to check out our roundup of must handy bookmarklets. Toggle ‘Em All [via [...]
April 19th, 2009 at 11:29 am
[...] without the bloat of extensions, make sure to check out our roundup of must handy bookmarklets. Toggle ‘Em All [via [...]
April 19th, 2009 at 12:09 pm
[...] without the bloat of extensions, make sure to check out our roundup of must handy bookmarklets. Toggle ‘Em All [via [...]
April 19th, 2009 at 2:08 pm
[...] without the bloat of extensions, make sure to check out our roundup of must handy bookmarklets. Toggle ‘Em All [via [...]
April 19th, 2009 at 2:19 pm
[...] without the bloat of extensions, make sure to check out our roundup of must handy bookmarklets. Toggle ‘Em All [via gHacks] Tagged:bookmarkletstime [...]
April 19th, 2009 at 7:27 pm
[...] without the bloat of extensions, make sure to check out our roundup of must handy bookmarklets. Toggle ‘Em All [via [...]
April 20th, 2009 at 12:04 am
[...] without the bloat of extensions, make sure to check out our roundup of must handy bookmarklets. Toggle ‘Em All [via [...]
April 20th, 2009 at 9:02 am
[...] Check/toggle ‘em all / phpied.com [...]
April 20th, 2009 at 6:53 pm
[...] without the bloat of extensions, make sure to check out our roundup of must handy bookmarklets. Toggle ‘Em All [via [...]
April 21st, 2009 at 9:30 am
[...] 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 [...]
April 21st, 2009 at 10:19 am
cool bookmarklet, can this check/toggle function be included for user-selected area? (provided there are checkboxes within the selection)
April 29th, 2009 at 5:30 am
Thanks! that was very cooool! I didn’t know there were such kind of javascript. Thanks!
May 8th, 2009 at 6:06 am
[...] link Leave a Reply [...]
February 27th, 2010 at 3:37 am
This is an awesome feature. Much better than going through the hassle of installing an addon. Thanks
May 4th, 2010 at 8:21 pm
This works perfectly, 10/10
May 31st, 2010 at 1:55 pm
For a more robust version, change =checked to .click()
This will trigger any events associated with the form elements for some
(ill-conceived) forms, at the expense of a potentially large delay.
July 21st, 2010 at 2:50 am
Thanks for this tool.
It works great and saved me a lot of time selecting contacts in my e-mail program.(which should have had a “select all” function, but they somehow forgot to add)
Otto
August 5th, 2010 at 1:20 pm
Thanks, this is always a life saver when I have to work with 100′s of merchant accounts
October 6th, 2010 at 5:20 pm
Thanks for this. I knew there had to be a way to go around websites/forms that won’t let you select all. This will save me hours over a year.
October 18th, 2010 at 5:41 pm
Thanks, Just saved me hours deleting blog spam.
November 25th, 2010 at 9:08 pm
[...] http://www.phpied.com/checktoggle-em-all/ [...]
January 8th, 2011 at 2:56 am
…
Smashing wordpress web log here . . It’s difficult to find lineament writing like yours these clarence shepard day jr.. I genuinely prize peoples like you! take care and see you soon ….
February 4th, 2011 at 2:01 am
Rocks Dude, exactly what I was looking for, this bookmarklet is now in my toolbar.
February 15th, 2011 at 3:38 pm
Thanks for sharing! Works great in Drupal development where you have a screen full of checkboxes.
-Bronius
February 22nd, 2011 at 7:06 am
I thought that this was the answer, but for me I would like a *check* them all bookmarklet,
rather than toggle them all. The pages below claim to provide a check all bookmarklet
http://www.aeonscope.net/2010/05/25/jquery-check-all-bookmarklet/
http://en.gibney.org/bookmarklets
but in fact they toggle too. Is there a way to check all, rather than toggle all?
March 18th, 2011 at 7:43 am
This seems to work well, fine on your test page. But, how do I use it. All i can do is toggle the test page.
March 18th, 2011 at 9:01 am
[...] However, there are some plugins for Firefox like CheckFox or even a bookmarklet you can use called Toggle Em All which will auto checkmark every single box on the page so you can mass unfollow the inactive [...]
April 13th, 2011 at 12:34 pm
[...] … via phpied.com [...]
June 29th, 2011 at 8:58 am
nice
June 30th, 2011 at 4:32 pm
Wow thanks for this. Saved me a ton of time!
August 9th, 2011 at 4:05 am
Thank You Very Much, you saved me a lot of time with this smart tool!
Keep up the good work dude!
August 23rd, 2011 at 2:01 pm
Thanks a lot for this superb solution
September 12th, 2011 at 6:02 am
Thank you, thank you, thank you. I was geting frustrated because a part of my job requires me to select thousands of items on a web interface limited to 15 items per page and delete them. With no select all function! This makes it just so much easier.
October 22nd, 2011 at 1:53 am
[...] books from Shelfari. Going to the list view of your books (you must be logged-in) then using the Check/toggle ‘em all bookmarklet to select remove all books, in the list view, is the fastest way to delete books from your Shelfari [...]
March 5th, 2012 at 11:24 pm
Thank you for the bookmarklet. But I would still be interested to find a check them all bookmarklet to check all the boxes on the page even if some are already checked.
April 16th, 2012 at 3:47 pm
Thanks so much! Appreciate it a whole bunch.
May 14th, 2012 at 10:01 am
To have it check all instead (after which you could use Toggle ‘Em All to uncheck everything),
1. Bookmark it again, then go to it in your browser’s bookmark organizer/editor.
2. Edit the bookmark name (“Check ‘Em All” perhaps?)
3. Edit the bookmark url, which is tightly packed javascript. Don’t be intimidated, just look for the only exclamation point and change just “!inputs[i].checked” to “true”. You’re only editing between the %20 and the semicolon.
This works by making each box’s checkedness true, rather than flip. Cheers.
June 16th, 2012 at 1:38 pm
thank you
June 18th, 2012 at 2:17 pm
Thanks so much. i have been searching for “all check” function. thanks !
July 17th, 2012 at 9:59 am
Thanks for publishing this, it saved me a lot of time!
July 18th, 2012 at 2:41 am
[...] in a web-browser?Post Bahaa' Awartany, InternetierHere is a simple solution http://www.phpied.com/checktoggl…A bookmarklet that can do it for you.Comment Loading… • Post • 12:41am Add [...]
August 5th, 2012 at 2:25 pm
Thanks a lot for this brilliant code. It worked perfectly in IE 9 and saved me days of repettitive work!
August 13th, 2012 at 2:08 am
I was using a site that was looking for javascript click events on the checkboxes. The bookmarklet as it was did not work on this site. So I wrote a couple of variants. The first variant uses the javascript click() function on every checkbox (effectively toggling every checkbox, but in a way that is compatible with raising the click events. The second variant only runs click() on checkboxes that are currently unchecked (effectively turning every checkbox to the checked state, also in a way that is compatible with raising the click events. Here they are:
toggleAll:
javascript:javascript:(function(){function checkFrames(w) {try {var inputs = w.document.getElementsByTagName(‘input’);for (var i=0; i 0){for(var i=0;i<w .frames.length;i++){var fr=w.frames[i];checkFrames(fr);}}}checkFrames(window);})()
checkAll:
javascript:javascript:(function(){function checkFrames(w) {try {var inputs = w.document.getElementsByTagName('input');for (var i=0; i 0){for(var i=0;i<w .frames.length;i++){var fr=w.frames[i];checkFrames(fr);}}}checkFrames(window);})()
September 2nd, 2012 at 1:36 pm
Brilliant. <3
September 5th, 2012 at 5:19 am
Exactly what I was looking for. Props to you!
October 8th, 2012 at 3:36 pm
Nice. Thanks!
December 3rd, 2012 at 4:38 pm
[...] to http://www.phpied.com/checktoggle-em-all/ . The article tell you how to check the checkbox by using Javascript. You need to drag [...]
March 11th, 2013 at 4:04 am
Thanks for the Toggle All bookmark-let. Simple yet very useful to toggle all checkboxes on a page. A big time saver, I say.
April 15th, 2013 at 7:32 am
It’s actually very complex in this busy life to listen news on Television, so I simply use internet for that purpose, and get the most recent news.
my web page; niche targeted guest posts
April 27th, 2013 at 11:48 am
Damn this was helpfull, thanks!