Page 1 of 1

How can I uncheck a Radiobutton?

Posted: Thu Jul 31, 2014 8:34 pm
by xman

I've tried several options listed in the forum, but unchecking the radio button does not work for me. What I want is that, the next click on a checked ratio button should uncheck it.

I have JS on "click" event on the radio button, which does the following:

if (Appery("radiobutton").is(':checked')) {
alert("found button is checked, will uncheck it now");
Appery("radiobutton").removeAttr('checked');
} else {
alert("found button is Un-checked, will check it now");
Appery("radiobutton").attr('checked', 'checked');
}

Once checked, the radio button never gets unchecked. Alert's do print out the correct expected values, so the check in the if statement is working.
-
-


How can I uncheck a Radiobutton?

Posted: Thu Jul 31, 2014 8:48 pm
by Kateryna Grynko

Hi,

Please check this thread: http://stackoverflow.com/questions/21...