Help - Search - Members - Calendar
Full Version: Focus on username
Movable Type Community Forum > Additional Resources > Tips and Tricks
youlovepubs
Replace login.tmpl with this...
CODE
<html>
<head>

<meta name="description" content="MOVABLE TYPE: Personal Publishing System" />
<meta http-equiv="Content-Type" content="text/html; charset=<TMPL_VAR NAME=LANGUAGE_ENCODING>" />

<title>MOVABLE TYPE :: Personal Publishing System</title>

<link rel="stylesheet" href="<TMPL_VAR NAME=STATIC_URI>styles.css" type="text/css">

<script language="JavaScript">
<!--

if ((!(navigator.appVersion.indexOf('MSIE') != -1) &&
     (parseInt(navigator.appVersion)==4))) {
   document.write("<STYLE TYPE=\"text/css\">");
   document.write("BODY { margin-top: -8px; margin-left: -8px; }");
   document.write("</style>");
}

var origWidth, origHeight;
if ((navigator.appName == 'Netscape') &&
   (parseInt(navigator.appVersion) == 4)) {
   origWidth = innerWidth;
   origHeight = innerHeight;
   window.onresize = restore;
}

function restore () {
   if (innerWidth != origWidth || innerHeight != origHeight)
       location.reload();
}

//-->
</script>

</head>

<TMPL_IF NAME=IS_BOOKMARKLET>
<body class="pop">
<TMPL_ELSE>
<body onload = "document.logform.username.focus();window.defaultStatus='Done';">

<!-- Logo and top nav -->

<TMPL_INCLUDE NAME="logonav.tmpl">

<!-- End logo and top nav -->

</TMPL_IF>

<!-- Begin main content -->

<table border="0" cellspacing="0" cellpadding="0">

<tr>
<td colspan="2"><img src="<TMPL_VAR NAME=STATIC_URI>images/spacer.gif" width="1" height="<TMPL_IF NAME=IS_BOOKMARKLET>50<TMPL_ELSE>35</TMPL_IF>"></td>
</tr>

<tr>
<td width="39"><img src="<TMPL_VAR NAME=STATIC_URI>images/spacer.gif" width="39" height="1"></td>
<td width="400">

<form method="post" name="logform" id="logform" action="<TMPL_VAR NAME=SCRIPT_URL>">
<TMPL_IF NAME=IS_BOOKMARKLET>
<input type="hidden" name="mode=start_recover', 'recover', 'width=370,height=200')"><MT_TRANS phrase="Forgot your password?"></a></font>

</form>
</td>
</tr>

</table>

<!-- End main content -->

<TMPL_IF NAME=IS_BOOKMARKLET>
<TMPL_ELSE>

<!-- Begin copyright and version info -->
<TMPL_INCLUDE NAME="copyright.tmpl">
<!-- End copyright and version info -->

</TMPL_IF>

</body>
</html>

...simply focuses the cursor in the username field. Fixes an irritating pate hate of mine.

Ste.
micahgoulart
the ikonboard took out the onload part.. let me see if i can include it

CODE
<body onLoad = "document.logform.username.focus();window.defaultStatus='Done';">


just remove the spaces before and after the "=" sign...

this used to irritate me too, but i just set the Login to remember me... goes right in. but if many people use your pc, i guess this is the second-best option. they should modify their default template to include the focus() handler.
youlovepubs
Cheers for that... #### Ikonboard.

Have modified the original post for anyone who wants to cut, paste, save and upload.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.