File tree 1 file changed +6
-6
lines changed
1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 1
1
/**
2
- * Gravity Perks // Populate Anything // Remove Empty Checkbox Choices
2
+ * Gravity Perks // Populate Anything // Remove Empty Choices
3
3
* https://gravitywiz.com/documentation/gravity-forms-populate-anything/
4
4
*
5
5
* 1. Install this snippet with our free Custom JavaScript plugin.
6
6
* https://gravitywiz.com/gravity-forms-custom-javascript/
7
7
*/
8
8
9
- var $containers = $ ( '.gfield_checkbox ' ) ;
9
+ var $containers = $ ( '.gfield--type-choice ' ) ;
10
10
11
11
// On page load.
12
12
$containers . each ( function ( ) {
13
- gwizRemoveEmptyCheckboxes ( $ ( this ) ) ;
13
+ gwizRemoveEmptyChoices ( $ ( this ) ) ;
14
14
} ) ;
15
15
16
16
// Show/hide checkboxes when the field is manipulated.
17
17
$containers . bind ( 'DOMNodeInserted DOMNodeRemoved' , function ( ) {
18
- gwizRemoveEmptyCheckboxes ( $ ( this ) ) ;
18
+ gwizRemoveEmptyChoices ( $ ( this ) ) ;
19
19
} ) ;
20
20
21
- function gwizRemoveEmptyCheckboxes ( $elem ) {
22
- $elem . find ( 'input[type="checkbox"]' ) . each ( function ( ) {
21
+ function gwizRemoveEmptyChoices ( $elem ) {
22
+ $elem . find ( 'input[type="checkbox"], input[type="radio"] ' ) . each ( function ( ) {
23
23
if ( ! $ ( this ) . val ( ) ) {
24
24
$ ( this ) . parent ( ) . hide ( ) ;
25
25
}
You can’t perform that action at this time.
0 commit comments