<td<?php echo ($column_comments ? "" : " class='hidden'"); ?>><input name="fields[<?php echo $i; ?>][comment]" value="<?php echo h($field["comment"]); ?>" maxlength="255">
<?php } ?>
<?php
- echo "<td class='nowrap'><input type='image' name='add[$i]' src='../adminer/static/plus.gif' alt='+' title='" . lang('Add next') . "' onclick='var x = editing_add_row(this, $allowed); if (x) { x.focus(); x.onchange = function () { }; } return !x;'>";
+ echo "<td class='nowrap'><input type='image' name='add[$i]' src='../adminer/static/plus.gif' alt='+' title='" . lang('Add next') . "' onclick='return !editing_add_row(this, $allowed, 1);'>";
echo " <input type='image' name='drop_col[$i]' src='../adminer/static/cross.gif' alt='x' title='" . lang('Remove') . "' onclick='return !editing_remove_row(this);'>";
echo " <input type='image' name='up[$i]' src='../adminer/static/up.gif' alt='^' title='" . lang('Move up') . "'>";
echo " <input type='image' name='down[$i]' src='../adminer/static/down.gif' alt='v' title='" . lang('Move down') . "'>";
}
}
-function editing_add_row(button, allowed) {
+function editing_add_row(button, allowed, focus) {
if (allowed && row_count >= allowed) {
return false;
}
}
tags = row.getElementsByTagName('input');
tags2 = row2.getElementsByTagName('input');
- var ret = tags2[0]; // IE loose tags2 after insertBefore()
+ var input = tags2[0]; // IE loose tags2 after insertBefore()
for (var i=0; i < tags.length; i++) {
if (tags[i].name == 'auto_increment_col') {
tags2[i].value = x;
editing_name_change(tags[0]);
};
row.parentNode.insertBefore(row2, row.nextSibling);
+ if (focus) {
+ input.onchange = function () {
+ editing_name_change(input);
+ };
+ input.focus();
+ }
added += '0';
row_count++;
- return ret;
+ return true;
}
function editing_remove_row(button) {