Forked from carlitoescobar/gravityforms-checkbox-checkall.js
Created
May 23, 2018 10:40
-
-
Save esoileme/40f016443066979337d4698c888dcad6 to your computer and use it in GitHub Desktop.
Gravity Forms check all function (jQuery)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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