Posted on: 3/18/2014 5:16:19 AM | Views : 545

Hello,
i have one aspx page on which i write one javascript function as..
<script type="text/javascript" language="javascript"> var previousCheckId;
function SingleSelect(chkBox) { if (chkBox.checked) { if (previousCheckId) { document.getElementById(previousCheckId).checked = false; } previousCheckId = chkBox.getAttribute('id'); } document.getElementById('hfData').value = previousCheckId; } </script>

This javascript function perform two tasks for me.
1.Makes sure that only one checkbox checked at a time amongst N checkboxes of the page.
2.Also set the value of hidden field to the id of currently checked checkbox.

...

Go to the complete details ...