Do you have a question? Post it now! No Registration Necessary. Now with pictures!
November 21, 2005, 4:33 pm
rate this thread
On loading a page i'm trying to sefocus to a button on the page, (the only
button) so that I can press return and it will have the effect of clicking
Here is what I'm doing at the moment but it's still not passing focus...
<BODY class="PageBody" onload=setFocus() >
<TD class="WidgetCell" align="center">
You have been logged out successfully.
<INPUT class="button" type="button" onclick="location.replace(
'./index.jsp' )" value="Login" />
Cheers if anyone has any idea's
Re: SetFocus issue...
As you talk about yourself being the one who will press return I
presume this is a personal page that no one else will use. If it is
going on the WWW for general use then don't muck about with the focus
That assumes the MSIE document model and gives focus to the element
with id="button". The standard way of doing this would be
The title element should be a child of the head element.
setFocus() should be quoted as ( and ) are not on the list of
characters that can be used in unquoted attribute values.
Hello? It's 2005, use CSS margins.
If all the button is doing is calling a new page then an ordinary link
is more reliable. You can even style it to look like a button if you
As your button doesn't have id="button" it isn't affected at all by the