form : manage correctely the checkboxes with values (the values can be defined and set to no "unset")
git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@3106 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
28
form.php
28
form.php
@@ -477,18 +477,22 @@ class formfield
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (isset ($this->values[$key]) &&
|
if (isset ($this->values[$key]))
|
||||||
$this->values[$key] !== null &&
|
{
|
||||||
$this->values[$key] !== false &&
|
if ($this->values[$key] !== null &&
|
||||||
$this->values[$key] !== "unset" &&
|
$this->values[$key] !== false &&
|
||||||
$this->values[$key] !== "")
|
$this->values[$key] !== "unset" &&
|
||||||
$res .= " checked='checked'";
|
$this->values[$key] !== "")
|
||||||
elseif (isset ($this->defaults[$key]) &&
|
$res .= " Checked='checked'";
|
||||||
$this->defaults[$key] !== null &&
|
}
|
||||||
$this->defaults[$key] !== false &&
|
elseif (isset ($this->defaults[$key]))
|
||||||
$this->defaults[$key] !== "unset" &&
|
{
|
||||||
$this->defaults[$key] !== "")
|
if ($this->defaults[$key] !== null &&
|
||||||
$res .= " checked='checked'";
|
$this->defaults[$key] !== false &&
|
||||||
|
$this->defaults[$key] !== "unset" &&
|
||||||
|
$this->defaults[$key] !== "")
|
||||||
|
$res .= " cheked='checked'";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (isset ($this->hidden) && $this->hidden !== FALSE)
|
if (isset ($this->hidden) && $this->hidden !== FALSE)
|
||||||
$res .= " style='display:none'";
|
$res .= " style='display:none'";
|
||||||
|
|||||||
Reference in New Issue
Block a user