radio button list checked event not firing after unchecked using javascript
I have a checkmark that when the user clicked on it if it's checked then a radiobuttonlist is visible. When the checkmark is unchecked the radiobuttonlist is not visible. What I want to do is, when the checkmark gets unchecked if any item of the radiobuttonlist is checked I want to uncheck it, so if the user set the checkmark to checked again I want the radiobuttonlist to be visible but with all the items unchecked.
This is wat I did using JavaScript:
elementRef = document.getElementById('<%= rowFlightClass.ClientID %>');
clearList(elementRef)
function clearList(elementRef) {
var inputEle开发者_如何学GomentArray = elementRef.getElementsByTagName('input');
for (var i = 0; i < inputElementArray.length; i++) {
var inputElement = inputElementArray[i];
inputElement.checked = false;
}
}
but the radio buttons are not completely cleared, they are checked in memory, it seems.
With this code it looks like they are cleared but if you click on the previously selected radiobutton selected it's not firing the selectedindexchange event.
You can get the checked and unchecked example from the following link- if it can help you.
http://www.aoiblog.com/checked-and-unchecked-the-radio-option-using-java-script/
精彩评论