Hi everybody,
Can someone help me to get rid of this javascipt error.
I have one javascript function as below in one
JSP application.
What i intend to do with this function is whenever user selects any of radio
button from group of radio buttons, the selected radio button should get focus. I have many HTML controls on this page besides radio buttons.
Here is the code.
function setFocus()
{
obj=document.forms["formname"].elements;
for (i=0;i<obj.length;i++){
if (obj[ i ].type=="radio" ){
if( obj[ i ].checked == true ){
obj[ i ].focus();
}
}
}
}
I m calling this function at the end of page.This works perfectly fine in IE 6.0 but it does not work in IE 5.If i try to access same in IE 5, i m getting javascript error..
"Error: Can't move focus to the control because it is invisible, not enabled, or of a type that does not accept a focus."
Can anybody have any idea why this does not work in IE 5?
Thanks.
Himanshu