I am getting errors when I change document.all() to document.getElementByID(). My site is ASP.NET 2.0. Everything works fine (in IE 7) with document.all(), but FF and Chrome and IE8 are all dying when they get to the document.all() call. The exact error I get is "Error: Object doesn't support this property or method".
<script type="text/javascript" language="javascript">
function setCheckedValue(radioObj, newValue)
{
if(!radioObj)
return;
var radioLength = radioObj.length;
if(radioLength == undefined)
{
radioObj.checked = (radioObj.value == newValue.toString());
return;
}
for(var i = 0; i < radioLength; i++)
{
radioObj[i].checked = false;
if(radioObj[i].value == newValue.toString())
{
radioObj[i].checked = true;
}
}
}
var rbl = document.getElementByID('rblRadio');
setCheckedValue(rbl,0);
</script>
rblRadio is a radio button list that is created using a NET repeater control. Could that have something to do with it? The website is using master pages... I can't think of anything else that may be pertinent... I must be missing something here as I have been led to beleve that document.getElementByID is pretty much the basis of much of javascripts functionality. I can't imagine it not being supported...
Thanks for any help in advance!
-Greg