Welcome visitor
* Login
* Register
It is currently May 21st, 2019, 12:35 am
All times are UTC [ DST ]
* Search
View unanswered posts - View active topics

FORUMS » Client Side » HTML



Post new topic Reply to topic  [ 2 posts ] 
Author Message
  Get cursor on username input
PostPosted: December 15th, 2009, 4:45 pm 

Posts: 17
Hi, I have a screen with 2 inputs, one for the username the other for the password. What could I do to set the focus on the username onload and avoid the tab key to go to the password field? It should only get focus with click of the mouse.

I've tried this to set the focus but it wont work
<input onload="this.focus();" />


Top
 Profile  
 
  Re: Get cursor on username input
PostPosted: December 15th, 2009, 5:11 pm 
User avatar

Posts: 63
That's because the input doesn't support the onload event.
<body onload="document.getElementById('username').focus();">
<input id="username">
<input type="password" tabindex="-1">


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

FORUMS » Client Side » HTML


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron