![]() |
Can the Username Field be made Active upon Page Load?
When someone brings up the main vB 3.0 page, I would like the Username field to be automatically active. The focus should be there - that way as soon as the page loads, users can just start typing in order to log themselves in.
Can this be done without getting in the way of anything else that happens upon page load? |
not too terribly difficult... you'll be editing the "navbar" template (about a quarter of the way down through the file). first you need to add a "name" attribute to the login form...
HTML Code:
<!-- login form --> HTML Code:
<!-- login form --> Then just add the following javascript to the end of the login form section... HTML Code:
<script type="text/javascript"> |
Wnorris, thank you!
That did the job quite well. :) Out of curiosity, on a similar question posted at vB.com - the concern came up that some vB elements require the onLoad in the body tag, and this mod was assumed to need to be triggered onLoad. Is there any concern that the code you provided will interfere with any other elements? |
not at all... the onLoad portion of the body tag will be called regardless. the only time you might have a problem is if you had another element trying to get focus, in which case the last one to call focus() wins.
|
All times are GMT. The time now is 09:00 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|