diff --git a/adminer/include/editing.inc.php b/adminer/include/editing.inc.php
index 4f4f615f..2c09aec7 100644
--- a/adminer/include/editing.inc.php
+++ b/adminer/include/editing.inc.php
@@ -267,7 +267,7 @@ function edit_fields($fields, $collations, $type = "TABLE", $foreign_keys = arra
| | " onkeyup="if (this.value != this.getAttribute('value')) { this.onchange(); this.setAttribute('value', this.value) }" onchange="this.previousSibling.checked = true;">
+echo checkbox("fields[$i][has_default]", 1, $field["has_default"]); ?>" onkeyup="keyupChange.call(this);" onchange="this.previousSibling.checked = true;">
" : ""); ?>
f.selectedIndex) f.selectedIndex = $first;\"" : "");
+ $onchange = ($first ? " onchange=\"var f = this.form['function[" . h(js_escape(bracket_escape($field["field"]))) . "]']; if ($first > f.selectedIndex) f.selectedIndex = $first;\" onkeyup='keyupChange.call(this);'" : "");
$attrs .= $onchange;
echo (count($functions) > 1
? ""
diff --git a/adminer/static/functions.js b/adminer/static/functions.js
index 506ba054..819e6655 100644
--- a/adminer/static/functions.js
+++ b/adminer/static/functions.js
@@ -435,6 +435,16 @@ function functionChange(select) {
helpClose();
}
+/** Call this.onchange() if value changes
+* @this HTMLInputElement
+*/
+function keyupChange() {
+ if (this.value != this.getAttribute('value')) {
+ this.onchange();
+ this.setAttribute('value', this.value);
+ }
+}
+
/** Create AJAX request
|