Skip to content
Browse files

Auto-focus user-name in login form

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1497 7c3ca157-0c34-0410-bff1-cbf682f78f5c
  • Loading branch information...
1 parent c40d1d0 commit 4269b7b239d68a330266296462a0094850c4c76f jakubvrana committed Apr 26, 2010
Showing with 8 additions and 2 deletions.
  1. +4 −1 adminer/include/adminer.inc.php
  2. +4 −1 editor/include/adminer.inc.php
View
5 adminer/include/adminer.inc.php
@@ -41,9 +41,12 @@ function loginForm() {
<table cellspacing="0">
<tr><th><?php echo lang('System'); ?><td><?php echo (count($possible_drivers) > 3 ? html_select("driver", $drivers, DRIVER) : "<input type='hidden' name='driver' value='" . key($drivers) . "'>" . reset($drivers)); ?></tr>
<tr><th><?php echo lang('Server'); ?><td><input name="server" value="<?php echo h(SERVER); ?>">
-<tr><th><?php echo lang('Username'); ?><td><input name="username" value="<?php echo h($_GET["username"]); ?>">
+<tr><th><?php echo lang('Username'); ?><td><input id="username" name="username" value="<?php echo h($_GET["username"]); ?>">
<tr><th><?php echo lang('Password'); ?><td><input type="password" name="password">
</table>
+<script type="text/javascript">
+document.getElementById('username').focus();
+</script>
<?php
echo "<p><input type='submit' value='" . lang('Login') . "'>\n";
if ($this->permanentLogin()) {
View
5 editor/include/adminer.inc.php
@@ -29,9 +29,12 @@ function database() {
function loginForm() {
?>
<table cellspacing="0">
-<tr><th><?php echo lang('Username'); ?><td><input type="hidden" name="driver" value="server"><input type="hidden" name="server" value=""><input name="username" value="<?php echo h($_GET["username"]); ?>">
+<tr><th><?php echo lang('Username'); ?><td><input type="hidden" name="driver" value="server"><input type="hidden" name="server" value=""><input id="username" name="username" value="<?php echo h($_GET["username"]); ?>">
<tr><th><?php echo lang('Password'); ?><td><input type="password" name="password">
</table>
+<script type="text/javascript">
+document.getElementById('username').focus();
+</script>
<?php
echo "<p><input type='submit' value='" . lang('Login') . "'>\n";
if ($this->permanentLogin()) {

0 comments on commit 4269b7b

Please sign in to comment.
Something went wrong with that request. Please try again.