Skip to content

Commit 30437d7

Browse files
authored
gw-none-of-the-above-checkbox.js: Added variable to control whether "None of the Above" gets disabled. It now defaults to not being disabled.
1 parent 24e0397 commit 30437d7

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

gravity-forms/gw-none-of-the-above-checkbox.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@
2121
*/
2222
$( '.gw-none-of-the-above' ).each( function() {
2323

24-
var $field = $( this );
25-
var $last = $field.find( '.gchoice:last-child input' );
26-
var $others = $field.find( 'input' ).not( $last );
24+
var disable_nota = false;
25+
var $field = $( this );
26+
var $last = $field.find( '.gchoice:last-child input' );
27+
var $others = $field.find( 'input' ).not( $last );
2728

2829
// If "None of the Above" choice is checked by default.
2930
if ( $last.prop( 'checked' ) ) {
@@ -45,7 +46,7 @@ $( '.gw-none-of-the-above' ).each( function() {
4546
} );
4647

4748
$others.on( 'click', function() {
48-
if ( $others.filter( ':checked' ).length ) {
49+
if ( $others.filter( ':checked' ).length && disable_nota ) {
4950
$last.prop( 'disabled', true );
5051
} else {
5152
$last.prop( 'disabled', false );

0 commit comments

Comments
 (0)