diff --git a/editing.inc.php b/editing.inc.php index 295ada11..f3dd183c 100644 --- a/editing.inc.php +++ b/editing.inc.php @@ -19,8 +19,8 @@ function input($name, $field, $value) { echo ' '; } } else { - $first = (isset($_GET["select"]) ? 2 : 1); - $onchange = ($field["null"] || isset($_GET["select"]) ? ' onchange="var f = this.form[\'function[' . addcslashes($name, "\r\n'\\") . ']\']; f.selectedIndex = Math.max(f.selectedIndex, ' . $first . ');"' : ''); + $first = $field["null"] + isset($_GET["select"]); + $onchange = ($first ? ' onchange="var f = this.form[\'function[' . addcslashes($name, "\r\n'\\") . ']\']; if (' . $first . ' > f.selectedIndex) f.selectedIndex = ' . $first . ';"' : ''); $options = array(""); if (!isset($_GET["default"]) && preg_match('~char|date|time~', $field["type"])) { $options = (preg_match('~char~', $field["type"]) ? array("", "md5", "sha1", "password", "uuid") : array("", "now"));