hi,
this is my Javscript which behaves like an Radiobutton. where user can select only 1 option at a time (ex: if he select item1 and selects item2 then item1 gets deselected, as he as selected item2 if he clciks again on item2 it gets deseletced.) which make user either select any one item or deleselect the selected item to
this condition works fine
issue
i have an button in page once user clicks that button again if user selects any item[eg item1 is selected before cliking on the button. then after clcking the button. and now if we selected any item in checkboxlist the initally selected item1 is not getting deselected when i am selecting another item in check boxlist
below is my code
var objChkd;
function HandleOnCheck()
{
var chkLst = document.getElementById('CheckBoxList1');
if(objChkd && objChkd.checked)
objChkd.checked=false;objChkd = event.srcElement;
}
and register the client event to the 'CheckBoxList1' at the Page_load as
CheckBoxList1.Attributes.Add("onclick","return HandleOnCheck()");
in .cs file i dnt want to do this CheckBoxList1.clearSelection();
any help would be great
thank you