01
Jul
09

Javascript Select All/Check All Checkboxes (Updated)






In my day-to-day SEO work, there are many sites I use that have a bunch of checkboxes on a single page. For example, in SEO, this is usually to check the box beside websites I want to trade links with. Well this gets tidious, so I went on the hunt for some kind of Javascript, Firefox-addon or mini-program that would do this with 1 click of the mouse. Here’s what I figured out…

At the top of my Firefox, I have a Links bar. I simply created a new link, and added the following code as the URL:

javascript:(function(){%20function%20toggle(box){%20temp=box.onchange;%20box.onchange=null;%20box.checked=!box.checked;%20box.onchange=temp;%20}%20var%20x,k,f,j;%20x=document.forms;%20for%20(k=0;%20k<x.length;%20++k)%20{%20f=x[k];%20for%20(j=0;j<f.length;++j)%20if%20(f[j].type.toLowerCase()%20==%20%22checkbox%22)%20toggle(f[j]);%20}%20})();

I honestly don’t recall where I found this - I’ve been using it for several weeks. But thanks to whoever I found it from. (If I find the site, or you email me, I’ll put the link here.)

Basically what that does is go through each form on a page and toggle the checkboxes on and off. It’s great as a quick-link in my Links bar - I can load the page, click that link (checking all of the check boxes on a page) and click submit. Done!


12 Responses to “Javascript Select All/Check All Checkboxes (Updated)”


  1. 1 shopping cart Jul 15th, 2008 at 10:53 pm

    Very nice post. Because we need check all boxes very commonly used in websites

  2. 2 shaikamjad Jul 23rd, 2008 at 8:55 am

    It’s good

  3. 3 Web development India Mar 17th, 2009 at 1:23 am

    Rightwaysolution is leading web development company India

    http://www.rightwaysolution.com

  4. 4 Kelli Piperata Jun 28th, 2009 at 2:20 pm

    great post

  5. 5 roger Jun 29th, 2009 at 5:25 pm

    umm…is all the code there for that?

  6. 6 paul Nov 2nd, 2009 at 12:37 pm

    Interesting! Always looking for useful SEO tips.

  7. 7 25th Wedding Anniversary Mar 5th, 2010 at 3:58 am

    I appreciate you for having shared the updated java coding. It worked like a charm. Thanks.

  8. 8 New Bank Account Mar 5th, 2010 at 9:33 pm

    This code worked well for me. Thanks for sharing.

  9. 9 Credit Card Offers Mar 10th, 2010 at 1:07 am

    Hey, I really appreciate you for explaining things out & glad you shared the coding too. Thanks.

  10. 10 Horse Saddles Mar 10th, 2010 at 2:24 am

    The code worked smooth for me. I appreciate your help!

  11. 11 Chapel Hill Real Estate Mar 10th, 2010 at 2:56 am

    I appreciate you shared the updated java script code. The previous one was not working properly. Thanks.

  1. 1 fire » Blog Archive » Javascript Select All/Check All Checkboxes Pingback on Apr 26th, 2008 at 11:45 pm

Leave a Reply




Close
E-mail It