B
boldt.lars
This code works fine in Firefox and Opera, I can see that it put focus
on the correct input in IE, but by the time the page has loaded
completely it loses focus.
The first time you enter the page it works fine in IE too, but if you
click a link which gives the input a value after reloading the page the
above happens.
function setFocusOnForm() {
if (objectExists(document.formSystem)){
var elements =
document.formSystem.getElementsByTagName('input','textarea');
for (var x=0;x<elements.length;x++){
if (elements[x].tagName.toLowerCase() == 'textarea' ||
elements[x].tagName.toLowerCase() == 'input' &&
elements[x].type.toLowerCase() == 'text'){
elements[x].focus();
break;
}
}
}
}
function objectExists(obj) {
if (obj == null || obj == undefined){
return false;
} else {
return true;
}
}
in the body tag I run onload="setFocusOnForm()".
Anyone know why this happens?
on the correct input in IE, but by the time the page has loaded
completely it loses focus.
The first time you enter the page it works fine in IE too, but if you
click a link which gives the input a value after reloading the page the
above happens.
function setFocusOnForm() {
if (objectExists(document.formSystem)){
var elements =
document.formSystem.getElementsByTagName('input','textarea');
for (var x=0;x<elements.length;x++){
if (elements[x].tagName.toLowerCase() == 'textarea' ||
elements[x].tagName.toLowerCase() == 'input' &&
elements[x].type.toLowerCase() == 'text'){
elements[x].focus();
break;
}
}
}
}
function objectExists(obj) {
if (obj == null || obj == undefined){
return false;
} else {
return true;
}
}
in the body tag I run onload="setFocusOnForm()".
Anyone know why this happens?