Feedback on: irt.org FAQ Knowledge Base Q57
Worth:
Worth reading
Comments:
Otherwise use
parent.frameName.focus();
cya
Technical:
Not technical enough
Comments:
This will work for most browsers. IE 4-5 on mac mac requires something more creative as there is a bug in the focus() method.
I used the following function which is called from the body onLoad event.Notice that the function focuses a text field, which then focuses the window/frame itself. The whole sha-bang is placed in a hidden div. See code below.
<body bgcolor="#FFFFFF" onLoad="fucFocus()" leftmargin="0" topmargin="0">
<form>
<div id="hidden" style="position:absolute; left:0px; top:250px; width:85%; visibility: hidden;">
<input name="txtFocus" type="text" id="txtFocus" onfocus="window.focus()">
<script language="JavaScript">
function fucFocus(){
document.all.txtFocus.focus();
}
</script>
</div>
</form>
Worth:
Very worth reading
Length:
Technical:
Comments:
Thanks a lot. sweet and simple!