MDL-19907 rewrote validation for required fields in forms, including support for editor field. Added parameter to use strict (no spaces) required fields validation

This commit is contained in:
Marina Glancy
2011-07-29 13:51:26 +08:00
parent ca3e8e98a4
commit 7b5702b681
6 changed files with 176 additions and 9 deletions
-7
View File
@@ -1502,13 +1502,6 @@ class HTML_QuickForm extends HTML_Common {
$values[] = $this->getSubmitValue($elName);
}
$result = $registry->validate($rule['type'], $values, $rule['format'], true);
} else if ($rule['type'] === 'required' and $this->getElement($target)->_type === 'editor') {
//horrible horrible hack
if (!isset($submitValue['text']) or $submitValue['text'] === '') {
$result = false;
} else {
$result = true;
}
} elseif (is_array($submitValue) && !isset($rule['howmany'])) {
$result = $registry->validate($rule['type'], $submitValue, $rule['format'], true);
} else {