1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-22 16:21:28 +00:00

focus username input element on login form load (closes #70)

This commit is contained in:
Andrew Dolgov
2006-06-14 08:32:10 +01:00
parent 3a82bc6005
commit a1b48fd72a

View File

@@ -77,11 +77,31 @@
<body> <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"> <table width='100%' height='100%' class="loginForm">
<tr><td align='center' valign='middle'> <tr><td align='center' valign='middle'>
<form action="login.php" method="POST"> <form action="login.php" method="POST" name="loginForm">
<table class="innerLoginForm"> <table class="innerLoginForm">
@@ -111,5 +131,20 @@
<? db_close($link); ?> <? 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> </body>
</html> </html>