Skip to content

Commit

Permalink
gw-limit-columns-in-survey-field-to-single-selection.js: Fixed conf…
Browse files Browse the repository at this point in the history
…lict if using snippet with Gravity Forms theme framework.
  • Loading branch information
saifsultanc authored Jan 27, 2025
1 parent b2580db commit 18e602e
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,16 @@ $( document ).on( 'change', `#field_${GFFORMID}_${fieldId} input[type="radio"]`,
const $radiosInColumn = $table.find( `input[type="radio"][aria-labelledby*="${columnId}"]` );

// Deselect all other radio buttons in the same column.
$radiosInColumn.not( $selectedRadio ).prop( 'checked', false );
$radiosInColumn.not($selectedRadio).each(function () {
let $radio = $(this);
let $parentTd = $radio.closest('td');

$radio.prop('checked', false);

// if gsurvey-likert-selected class is added to the parent td, remove it (GF 2.5 Theme).
if ( $parentTd.length && $parentTd.hasClass( 'gsurvey-likert-selected' ) ) {
$parentTd.removeClass( 'gsurvey-likert-selected' );
}
});
}
});

0 comments on commit 18e602e

Please sign in to comment.