Clear radiobutton list selection using jquery
Question
I would like to clear Radiobutton list selection once user click the button. I have tried the following code but clears the selection in browser. When I access from backend(C#) selection is there. It doesn't clear the selection of the control really I guess. Any suggestion please.
<SharePoint:DVRadioButtonList ID="rblLst" runat="server" RepeatDirection="Horizontal">
</SharePoint:DVRadioButtonList>
<br/><input type="button" id="btnClearrblfinance" value="Clear Selection" onclick="ClearSelectionrblfinance()" />
JQuery to clear the control
$("table[id$=rblLst] input:radio:checked").removeAttr("checked");
Solution
Try below code:
$("table[id$=rblLst] input:radio:checked").prop('checked', false);
OR
$("#btnClearrblfinance").prop('checked', false);
Refer this link - https://jquery.com/upgrade-guide/3.0/#attributes
Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange