}
$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))) . '<td>';
+ echo (count($functions) > 1 ? html_select("function[$name]", $functions, !isset($function) || in_array($function, $functions) || isset($functions[$function]) ? $function : "", "functionChange(this);") : nbsp(reset($functions))) . '<td>';
$input = $adminer->editInput($_GET["edit"], $field, $attrs, $value); // usage in call is without a table
if ($input != "") {
echo $input;
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