When logging into the admin screen, the username field and password are displayed and a person can't help but want to just type the username, hit tab, type the password and press enter, but no focus is set. I added a little solution that focuses the username box and it should work for all browsers and no matter what you have customly added into your load events..
in /admin/template/{default}/content/login.tpl add the following code to the top of the page:
*replace {default} with a different name if oyu have changed the template you are using for the admin store manager, else just use default without the {}
Code: Select all
<script type="text/javascript">
addLoadEvent(setfocus);
function setfocus() {
var username = document.getElementsByName('username');
if(username[0]){
username[0].focus();
}
}
function addLoadEvent(func) {
var oldonload = window.onload;
if (typeof window.onload != 'function') {
window.onload = func;
} else {
window.onload = function() {
if (oldonload) {
oldonload();
}
func();
}
}
}
</script>
