diff --git a/adminer/include/functions.inc.php b/adminer/include/functions.inc.php
index eb51e595..59060016 100644
--- a/adminer/include/functions.inc.php
+++ b/adminer/include/functions.inc.php
@@ -673,7 +673,7 @@ function input($field, $value, $function) {
}
$onchange = ($first ? " onchange=\"var f = this.form['function[" . js_escape($name) . "]']; if ($first > f.selectedIndex) f.selectedIndex = $first;\"" : "");
$attrs .= $onchange;
- echo (count($functions) > 1 ? html_select("function[$name]", $functions, !isset($function) || in_array($function, $functions) || isset($functions[$function]) ? $function : "") : nbsp(reset($functions))) . '
';
+ echo (count($functions) > 1 ? html_select("function[$name]", $functions, !isset($function) || in_array($function, $functions) || isset($functions[$function]) ? $function : "", "functionChange(this);") : nbsp(reset($functions))) . ' | ';
$input = $adminer->editInput($_GET["edit"], $field, $attrs, $value); // usage in call is without a table
if ($input != "") {
echo $input;
diff --git a/adminer/static/functions.js b/adminer/static/functions.js
index 6cf09ebc..2b9f3726 100644
--- a/adminer/static/functions.js
+++ b/adminer/static/functions.js
@@ -220,6 +220,21 @@ function editingKeydown(event) {
return true;
}
+/** Disable maxlength for functions
+* @param HTMLSelectElement
+*/
+function functionChange(select) {
+ var input = select.form[select.name.replace(/^function/, 'fields')];
+ if (selectValue(select)) {
+ if (input.origMaxLength === undefined) {
+ input.origMaxLength = input.maxLength;
+ }
+ input.removeAttribute('maxlength');
+ } else if (input.origMaxLength >= 0) {
+ input.maxLength = input.origMaxLength;
+ }
+}
+
/** Create AJAX request
|