Error message

Deprecated function: implode(): Passing glue string after array is deprecated. Swap the parameters in drupal_get_feeds() (line 394 of /home1/tylerfra/public_html/includes/common.inc).

Drupal - Use Browser Inspector to Check All Check Boxes on a Form

Category: 

In Drupal 7, on a content type edit screen, I needed to set the available menus for that content type. Some sites only have a few menus, other sites (particulary ones with lots of Organic Group menus) will have tons of menus to choose from. Clicking each checbox, when there are hundreds of them, over and over again through multiple content types is annoying. "Let's use computers to make our lives easier", said man.

You must disable Drupal 7 administrative pages in the overlay for this to work. You can toggle this on/off on your user edit form.

Open up your browser's inspector (Chrome Inspector, Firefox Firebug, etc), typically you would right click on near the checkboxes you need to select, then choose "Inspect Element". Once your inspector is up, switch to the 'Console' tab and enter a jQuery snippet like this.

jQuery('#edit-menu-options input:checkbox').each(function () {
 jQuery(this).attr('checked', true);
});

Change the jQuery selector to match your checkboxes and you're good to go. There you go, all better.