Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
142
rated 0 times [  143] [ 1]  / answers: 1 / hits: 24917  / 14 Years ago, wed, april 14, 2010, 12:00:00

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?


More From » asp-classic

 Answers
0

Are you calling focus when the page just loads (e.g. body's onload)?



This thread might help - it may get called in your code before DOM finished loading



Also, this page has a good test for focus() behavior:
http://hardlikesoftware.com/projects/IE8FocusTest.html


[#97080] Sunday, April 11, 2010, 14 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
kalynn

Total Points: 309
Total Questions: 105
Total Answers: 90

Location: Azerbaijan
Member since Fri, May 12, 2023
1 Year ago
;