Hi
I am using the following function which is called by onLoad in the BODY tag (e.g <BODY onLoad=FieldFocus('email');>):
function FieldFocus(fieldstr) {
document.forms[1].elements[fieldstr].focus();
if(document.forms[1].elements[fieldstr].type != "select-one"
{
document.forms[1].elements[fieldstr].select();
}
}
I have links that contain the variable to pass as the parameter to this function in the query string (e.g. "field=email"
, and also an anchor reference (e.g. "#editemail"
.
In Netscape (4.7), all works well i.e. when a link is clicked, the page scrolls itself to the anchor and the focus is set on the given form element and any text present in that field is selected. However, in IE (6), the page scrolls itself to the anchor, any text present is selected, but the focus is not set. The problem appears to be the presence of the anchor, as having tested without the anchors, the focus works ok.
Any ideas/suggestions?
Thanks

I am using the following function which is called by onLoad in the BODY tag (e.g <BODY onLoad=FieldFocus('email');>):
function FieldFocus(fieldstr) {
document.forms[1].elements[fieldstr].focus();
if(document.forms[1].elements[fieldstr].type != "select-one"
document.forms[1].elements[fieldstr].select();
}
}
I have links that contain the variable to pass as the parameter to this function in the query string (e.g. "field=email"
In Netscape (4.7), all works well i.e. when a link is clicked, the page scrolls itself to the anchor and the focus is set on the given form element and any text present in that field is selected. However, in IE (6), the page scrolls itself to the anchor, any text present is selected, but the focus is not set. The problem appears to be the presence of the anchor, as having tested without the anchors, the focus works ok.
Any ideas/suggestions?
Thanks