focus username input element on login form load (closes #70)
This commit is contained in:
parent
3a82bc6005
commit
a1b48fd72a
1 changed files with 36 additions and 1 deletions
37
login.php
37
login.php
|
@ -77,11 +77,31 @@
|
|||
|
||||
<body>
|
||||
|
||||
<script type="text/javascript">
|
||||
function init() {
|
||||
|
||||
if (arguments.callee.done) return;
|
||||
arguments.callee.done = true;
|
||||
|
||||
var login = document.forms["loginForm"].login;
|
||||
|
||||
login.focus();
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
if (document.addEventListener) {
|
||||
document.addEventListener("DOMContentLoaded", init, null);
|
||||
}
|
||||
window.onload = init;
|
||||
</script>
|
||||
|
||||
<table width='100%' height='100%' class="loginForm">
|
||||
|
||||
<tr><td align='center' valign='middle'>
|
||||
|
||||
<form action="login.php" method="POST">
|
||||
<form action="login.php" method="POST" name="loginForm">
|
||||
|
||||
<table class="innerLoginForm">
|
||||
|
||||
|
@ -111,5 +131,20 @@
|
|||
|
||||
<? db_close($link); ?>
|
||||
|
||||
<script type="text/javascript">
|
||||
/* for IE */
|
||||
function statechange() {
|
||||
if (document.readyState == "interactive") init();
|
||||
}
|
||||
|
||||
if (document.readyState) {
|
||||
if (document.readyState == "interactive" || document.readyState == "complete") {
|
||||
init();
|
||||
} else {
|
||||
document.onreadystatechange = statechange;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
Loading…
Reference in a new issue