form : the overwriting of hidden and read-only fields is done on values !
git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@3037 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
6
form.php
6
form.php
@@ -127,7 +127,7 @@ class form
|
|||||||
foreach ($_SESSION["domframework"]["form"]["fields"] as $field)
|
foreach ($_SESSION["domframework"]["form"]["fields"] as $field)
|
||||||
{
|
{
|
||||||
if ($field->type === "hidden" || $field->readonly !== null)
|
if ($field->type === "hidden" || $field->readonly !== null)
|
||||||
$values[$field->name] = $field->defaults;
|
$values[$field->name] = $field->values;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -148,6 +148,8 @@ class form
|
|||||||
{
|
{
|
||||||
if (count ($this->fields) === 0)
|
if (count ($this->fields) === 0)
|
||||||
throw new Exception ("Can't display a form without defined field", 500);
|
throw new Exception ("Can't display a form without defined field", 500);
|
||||||
|
if (isset ($_SESSION))
|
||||||
|
$_SESSION["domframework"]["form"]["fields"] = $this->fields;
|
||||||
$this->method = strtolower ($method);
|
$this->method = strtolower ($method);
|
||||||
$res = "";
|
$res = "";
|
||||||
$res = "<form action='#' method='$method'";
|
$res = "<form action='#' method='$method'";
|
||||||
@@ -225,8 +227,6 @@ class form
|
|||||||
$res .= "<script>document.getElementById('".$this->formName."_".
|
$res .= "<script>document.getElementById('".$this->formName."_".
|
||||||
$focusElement."').focus();</script>\n";
|
$focusElement."').focus();</script>\n";
|
||||||
$res .= "</form>\n";
|
$res .= "</form>\n";
|
||||||
if (isset ($_SESSION))
|
|
||||||
$_SESSION["domframework"]["form"]["fields"] = $this->fields;
|
|
||||||
return $res;
|
return $res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user