I'm using a gridview that has a radio button in one of the columns. It's used as a true/false flag. Anyways, because of the nature of my project, I require javascript to uncheck any radio buttons when I check another one. This works fine, except that my gridview is wrapped in an update panel. I am taking care of reintializing the jQuery on autopost back, but what's happening is upon post back, removing my checked radio button and not putting it back. If I don't use the jQuery it works fine(but then I don't get the button exclusitivity), so I think its my code. Here's the code I have.
<script type="text/javascript">
$(document).ready(function () {
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
function EndRequestHandler(sender, args) {
$("input").click(function () {
$("input").removeAttr('checked');
$(this).attr('checked','checked');
});
}
$("input").click(function () {
$("input").removeAttr('checked');
$(this).attr(':checked');
});
});
Is there a better way to write this code? Thanks.