]> git.joonet.de Git - adminer.git/commitdiff
Check default value on key press
authorJakub Vrana <jakub@vrana.cz>
Tue, 6 Aug 2013 20:44:47 +0000 (13:44 -0700)
committerJakub Vrana <jakub@vrana.cz>
Tue, 6 Aug 2013 20:44:47 +0000 (13:44 -0700)
adminer/include/editing.inc.php

index 5d5a15c9634c66cdb3a28965575d9f222eed0cd6..98aa143c698d390c739c22ea7e1951a081e6561f 100644 (file)
@@ -255,7 +255,7 @@ function edit_fields($fields, $collations, $type = "TABLE", $foreign_keys = arra
 <?php if ($type == "TABLE") { ?>
 <td><?php echo checkbox("fields[$i][null]", 1, $field["null"], "", "", "block"); ?>
 <td><label class="block"><input type="radio" name="auto_increment_col" value="<?php echo $i; ?>"<?php if ($field["auto_increment"]) { ?> checked<?php } ?> onclick="var field = this.form['fields[' + this.value + '][field]']; if (!field.value) { field.value = 'id'; field.onchange(); }"></label><td><?php
-echo checkbox("fields[$i][has_default]", 1, $field["has_default"]); ?><input name="fields[<?php echo $i; ?>][default]" value="<?php echo h($field["default"]); ?>" onchange="this.previousSibling.checked = true;">
+echo checkbox("fields[$i][has_default]", 1, $field["has_default"]); ?><input name="fields[<?php echo $i; ?>][default]" value="<?php echo h($field["default"]); ?>" onkeyup="if (this.value != this.getAttribute('value')) { this.onchange(); this.setAttribute('value', this.value) }" onchange="this.previousSibling.checked = true;">
 <?php echo (support("comment") ? "<td" . ($comments ? "" : " class='hidden'") . "><input name='fields[$i][comment]' value='" . h($field["comment"]) . "' maxlength='" . ($connection->server_info >= 5.5 ? 1024 : 255) . "'>" : ""); ?>
 <?php } ?>
 <?php