diff options
-rw-r--r-- | core/QuickForm2.php | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/core/QuickForm2.php b/core/QuickForm2.php index bbdc39e4c5..40d7f1246c 100644 --- a/core/QuickForm2.php +++ b/core/QuickForm2.php @@ -110,6 +110,17 @@ abstract class QuickForm2 extends HTML_QuickForm2 return isset($value[$elementName]) ? $value[$elementName] : null; } + public function getErrorMessages() + { + $messages = array(); + + foreach ($this as $element) { + $messages[] = $element->getError(); + } + + return array_filter($messages); + } + /** * Returns the rendered form as an array. * |