Hello I have a radio button I need to be able to toggle on and off. I know I should use a checkbox but unfortunately I am constrained to use radio buttons for reasons that would be too long to explain.
Its a single radio button so when I click on it, theres no way to turn it off.
Is it possible to toggle a single radio button on and off using jQuery?
This is what I have so far, but I cant get it to work.
jQuery('.gfield_radio li input').click(function() {
if(jQuery(this).is(':checked')) {
jQuery(this).prop('checked', true);
}
else if (!jQuery(this).is(':checked')) {
jQuery(this).prop('checked', false);
}
});
Any help would be greatly appreciated!
Thanks