Add this to common.inc.php :
$GLOBALS['js_include'][] = 'extension.js';
Create the extension.js file in the js folder:
jQuery(function(){ $('#create_table_form select[name=tbl_collation]').val('utf8_general_ci'); $('#append_fields_form select.column_type, #create_table_form select.column_type').live('change keyup',function(k,v){ var field = $(this).attr('name').replace(/[^0-9]/g,''); var val = $(this).val(); $('[name="field_attribute['+field+']"] option').attr('selected',false); $('[name="field_collation['+field+']"] option').attr('selected',false); $('[name="field_length['+field+']"]').val(''); if(val == 'VARCHAR'){ $('[name="field_length['+field+']"]').val('255'); $('[name="field_collation['+field+']"]').val('utf8_general_ci'); } if(val == 'INT'){ $('[name="field_attribute['+field+']"]').val('UNSIGNED'); $('[name="field_length['+field+']"]').val('11'); } }); });
Tested with phpMyAdmin 3.4.2. Also sets a few other useful default settings.
source share