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-08-02 08:50:51 +08:00
parent e8e1ad9100
commit 54641661e1
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 {