diff --git a/js/functions.js b/js/functions.js index d8c30bcbc8..938b43aa66 100644 --- a/js/functions.js +++ b/js/functions.js @@ -1371,6 +1371,12 @@ function PMA_createTableDialog( $div, url , target) $(this).closest('.ui-dialog-content').dialog('close').remove(); }; + // allow create-table form only once + if ($('#create_table_form').length) { + $('#create_table_form input[autofocus]').focus(); + return; + } + var $msgbox = PMA_ajaxShowMessage(); $.get( target , url , function(data) { @@ -1431,6 +1437,9 @@ function PMA_createTableDialog( $div, url , target) var $save_button = $('#create_table_form').find("input[name='do_save_data']"); $cancel_button.insertAfter($save_button); $button_pane.hide(); + + // focus table name input + $(this).find("input[autofocus]").focus(); }, close: function() { $(window).unbind('resize.dialog-resizer'); diff --git a/libraries/tbl_properties.inc.php b/libraries/tbl_properties.inc.php index 8a30f2ef32..fc77a913f5 100644 --- a/libraries/tbl_properties.inc.php +++ b/libraries/tbl_properties.inc.php @@ -563,10 +563,10 @@ echo PMA_generate_common_hidden_inputs($_form_params); unset($_form_params); if ($action == 'tbl_create.php') { ?> - +
+ class="textfield" autofocus />