Skip to content

Instantly share code, notes, and snippets.

@segovia94
segovia94 / Toggle all checkboxes bookmark.js
Last active August 29, 2015 14:01
Toggle all checkboxes
//requires jQuery 1.6 minimum
var $checkBoxes = $('input:checkbox');
$checkBoxes.prop("checked", !$checkBoxes.prop("checked"));
//bookmarklet created via: http://benalman.com/code/test/jquery-run-code-bookmarklet/
javascript:(function(e,a,g,h,f,c,b,d){if(!(f=e.jQuery)||g>f.fn.jquery||h(f)){c=a.createElement("script");c.type="text/javascript";c.src="http://ajax.googleapis.com/ajax/libs/jquery/"+g+"/jquery.min.js";c.onload=c.onreadystatechange=function(){if(!b&&(!(d=this.readyState)||d=="loaded"||d=="complete")){h((f=e.jQuery).noConflict(1),b=1);f(c).remove()}};a.documentElement.childNodes[0].appendChild(c)}})(window,document,"1.6",function($,L){var%20$checkBoxes=$("input:checkbox");$checkBoxes.prop("checked",!$checkBoxes.prop("checked"));});
// the required fields that we want to ignore
//$safe_fields = array('field_test2');
//just grab all fields in the second field group
$safe_fields = $form['#groups']['group_option2']->children;
// get a list of all errors
$errors = form_get_errors();
// this will clear Error msg queue
$messages = drupal_get_messages('error');