How to make .focus() work on a radio button array?

Posted by flavour404 on Stack Overflow See other posts from Stack Overflow or by flavour404
Published on 2010-04-14T01:54:18Z Indexed on 2010/04/14 2:13 UTC
Read the original article Hit count: 274

Filed under:
|
|

Hi,

I am trying to get the .focus() working in IE, it works in chrome etc. My form is called:

<form name="feedbackform" action="feedback.asp" target="_self" onsubmit="return

validate_txt(this)" method="post" style="margin: 0;">

my radio buttons:

<input type="radio" name="fb_commentype" value="Comment" />Comment
<input type="radio" name="fb_commentype" value="Complaint" />Complaint
<input type="radio" name="fb_commentype" value="Request" />Request

in my javascript I am trying to call using this line:

document.forms["feedbackform"].elements["fb_commentype"][0].focus();

As I said, it works in chrome, firefox blah blah blah but in IE 8 I am getting nada, zip and I don't know why, nor can I find a satisfactory answer, is there a way around it?

Thanks R.

© Stack Overflow or respective owner

Related posts about classic

Related posts about asp