Checkbox Select-All for Browser.

If you ever use a form that requires you to select/de-select a number of checkboxes, and the programmer hasn’t included a “Select-All” button on the page, then you might want to create a browser bookmark that will do the job.

I’m not sure how to create a Bookmark or Favorite from scratch, so I just go to any web page and click on “Add to Favorites…” or “Bookmark This Page.”  After the item is created, I right-click on it and go to Properties.  I change the name of the bookmark to something like, “Checkbox Select-All” and then I replace the existing URL or Location field with the coding shown below.

Here is the code:>>==>

javascript:function%20checkem(){var%20d=window.frames[0]?content.document:document;for(var%20x=0;x<d.forms.length;x++){var%20cSet=d.forms[x].elements;for(var%20i=0;i<cSet.length;i++){if(cSet[i].type==’checkbox’){cSet[i].checked=cSet[i].checked?false:true;}}}}void(checkem())

<==<<

Then when you go to a form that requires you to check all the boxes, just click on the bookmark and the boxes will be selected.  Again, and they will be un-selected.

Advertisements