Respect NOT NULL in onchange

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@525 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
jakubvrana 2008-10-09 12:24:43 +00:00
parent 644e3d75e7
commit b8ff2dfa6e

View file

@ -19,8 +19,8 @@ function input($name, $field, $value) {
echo ' <label><input type="radio" name="fields[' . $name . ']" value="' . (isset($_GET["default"]) ? (strlen($val) ? htmlspecialchars($val) : " ") : $i+1) . '"' . ($checked ? ' checked="checked"' : '') . ' />' . htmlspecialchars($val) . '</label>';
}
} 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"));