updating form handling of required validation, fixes #3869

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6391 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
gwoo 2008-01-19 21:52:13 +00:00
parent c91b3721bc
commit 411bf98d40

View file

@ -567,7 +567,9 @@ class FormHelper extends AppHelper {
$divOptions = array_merge($divOptions, $div);
}
if (in_array($this->field(), $this->fieldset['validates'])) {
$divOptions = $this->addClass($divOptions, 'required');
if (!isset($this->fieldset['validates'][$this->field()]['required']) || isset($this->fieldset['validates'][$this->field()]['required']) && $this->fieldset['validates'][$this->field()]['required'] !== false) {
$divOptions = $this->addClass($divOptions, 'required');
}
}
}