LSform : block form validation if element's errors is defined

This commit is contained in:
Benjamin Renard 2014-11-20 00:12:56 +01:00
parent 508e898210
commit 881323f813

View file

@ -272,6 +272,7 @@ class LSform {
$msg_error=getFData(_("%{label} attribute data is not valid."),$attr->getLabel()); $msg_error=getFData(_("%{label} attribute data is not valid."),$attr->getLabel());
} }
$this -> _elementsErrors[$attr->name][]=$msg_error; $this -> _elementsErrors[$attr->name][]=$msg_error;
$this -> can_validate=false;
} }
/** /**
@ -338,6 +339,9 @@ class LSform {
function checkData() { function checkData() {
$retval=true; $retval=true;
foreach ($this -> _postData as $element => $values) { foreach ($this -> _postData as $element => $values) {
if ($this -> definedError($element)) {
$retval=false;
}
if(!is_array($values)) { if(!is_array($values)) {
$values=array($values); $values=array($values);
} }