Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save esoileme/40f016443066979337d4698c888dcad6 to your computer and use it in GitHub Desktop.
Save esoileme/40f016443066979337d4698c888dcad6 to your computer and use it in GitHub Desktop.
Gravity Forms check all function (jQuery)
// Needed this for a client project, thanks! I improved upon it to make it more generic so you don't have to look up individual IDs on elements:
jQuery(document).ready(function(){
// Check all in Gravity Forms
jQuery('.checkall li:first-child input').click(function() {
jQuery(this).parent('li').parent('ul').find(':checkbox').attr('checked', this.checked);
});
});
// Just add a class "checkall" to your checkbox form item in Gravity Forms, it assumes the first item in the list will be the "All" option.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment