Re: QuickForm error object, messages
| From: | Mark Wiesemann | Date: | Thu, 15 Jun 2006 19:02:41 +0000 |
| Subject: | Re: QuickForm error object, messages | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-24389@lists.php.net to get a copy of this message | ||
Mark Steudel wrote:
> I would like to display a summary of errors at the top of my form and was
> wondering if there was some way to know if errors are set and a way to
> access the errors, something kinda like: [...]
(1) Dirty way: loop over $form->_errors ($_errors is a private array, so
this is dirty.)
(2) Clean way: loop over your elements and call
$form->getElementError($elementName); which returns the error message
for an element if there is one.
Regards,
Mark