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:
parent
644e3d75e7
commit
b8ff2dfa6e
|
@ -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>';
|
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 {
|
} else {
|
||||||
$first = (isset($_GET["select"]) ? 2 : 1);
|
$first = $field["null"] + isset($_GET["select"]);
|
||||||
$onchange = ($field["null"] || isset($_GET["select"]) ? ' onchange="var f = this.form[\'function[' . addcslashes($name, "\r\n'\\") . ']\']; f.selectedIndex = Math.max(f.selectedIndex, ' . $first . ');"' : '');
|
$onchange = ($first ? ' onchange="var f = this.form[\'function[' . addcslashes($name, "\r\n'\\") . ']\']; if (' . $first . ' > f.selectedIndex) f.selectedIndex = ' . $first . ';"' : '');
|
||||||
$options = array("");
|
$options = array("");
|
||||||
if (!isset($_GET["default"]) && preg_match('~char|date|time~', $field["type"])) {
|
if (!isset($_GET["default"]) && preg_match('~char|date|time~', $field["type"])) {
|
||||||
$options = (preg_match('~char~', $field["type"]) ? array("", "md5", "sha1", "password", "uuid") : array("", "now"));
|
$options = (preg_match('~char~', $field["type"]) ? array("", "md5", "sha1", "password", "uuid") : array("", "now"));
|
||||||
|
|
Loading…
Reference in a new issue