]> git.joonet.de Git - adminer.git/commitdiff
Auto-focus database name
authorJakub Vrana <jakub@vrana.cz>
Wed, 20 Oct 2010 10:40:27 +0000 (12:40 +0200)
committerJakub Vrana <jakub@vrana.cz>
Wed, 20 Oct 2010 10:40:27 +0000 (12:40 +0200)
adminer/database.inc.php

index 83e7ffb32e448d663a229c9e6dde791d5144ef5e..e0d91003495b32e06b1817449fbd9c373139296d 100644 (file)
@@ -57,10 +57,11 @@ if ($_POST) {
 <p>
 <?php
 echo ($_POST["add_x"] || strpos($name, "\n")
-       ? '<textarea name="name" rows="10" cols="40" onkeydown="return textareaKeydown(this, event);">' . h($name) . '</textarea><br>'
-       : '<input name="name" value="' . h($name) . '" maxlength="64">'
+       ? '<textarea id="name" name="name" rows="10" cols="40" onkeydown="return textareaKeydown(this, event);">' . h($name) . '</textarea><br>'
+       : '<input id="name" name="name" value="' . h($name) . '" maxlength="64">'
 ) . "\n" . ($collations ? html_select("collation", array("" => "(" . lang('collation') . ")") + $collations, $collate) : "");
 ?>
+<script type='text/javascript'>document.getElementById('name').focus();</script>
 <input type="hidden" name="token" value="<?php echo $token; ?>">
 <input type="submit" value="<?php echo lang('Save'); ?>">
 <?php