gplcb-checkbox-as-radio-button.js
Instructions
See “Where do I put snippets?” in our documentation for installation instructions.
Code
Filename: gplcb-checkbox-as-radio-button.js
Filename: gplcb-checkbox-as-radio-button.js
$( '.gplcb-checkbox-as-radio' ).find( 'input[type="checkbox"]' ).change( function() {
$( this ).parents( '.gfield' ).find( 'input[type="checkbox"]' ).prop( 'checked', false );
$( this ).prop( 'checked', true );
} );