Is there a way to have a “none of the above” checkbox that would uncheck all other options? I tried using the solution posted here:
but I’m getting a syntax error.
I pasted the following snippet:
$(‘.gfield-choice-input[value=“none”]’).on(‘change’, function() {
if ( $(this).is(‘:checked’) ) {
$(this).parent().siblings().find(‘.gfield-choice-input’).each( function() {
this.checked = false;
});
}
});
$(‘.gfield-choice-input:not([value=“none”])’).on(‘change’, function() {
if ( $(this).is(‘:checked’) ) {
$(this).parent().siblings().find(‘.gfield-choice-input[value=“none”]’).prop(‘checked’,false);
}
});
I get this error:
syntax error, unexpected ‘(’, expecting variable (T_VARIABLE) or ‘{’ or ‘$’