Do not consider disabled elements when checking form completion

Values of disabled inputs are not sent by browsers.

refs #5525
This commit is contained in:
Johannes Meyer 2014-07-21 08:57:41 +02:00
parent 6ed3d5fdbd
commit f5ac592645
1 changed files with 9 additions and 1 deletions

View File

@ -245,7 +245,15 @@ class Form extends Zend_Form
throw new LogicException('Forms without elements cannot be complete');
}
$missingValues = array_diff_key($elements, $formData);
$missingValues = array_diff_key(
array_filter(
$elements,
function ($el) {
return $el->getAttrib('disabled') === null;
}
),
$formData
);
return empty($missingValues);
}