RE: [PEAR] Re: QuickForm error object, messages
| From: | Mark Steudel | Date: | Thu, 15 Jun 2006 19:12:41 +0000 |
| Subject: | RE: [PEAR] Re: QuickForm error object, messages | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-24390@lists.php.net to get a copy of this message | ||
Cool thanks, is there a "clean way" to loop through the elements? The
element array looks private as well.
-----Original Message-----
From: Mark Wiesemann [mailto:wiesemann@php.net]
Sent: Thursday, June 15, 2006 12:03 PM
To: pear-general@lists.php.net
Subject: [PEAR] Re: QuickForm error object, messages
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
--
PEAR General Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php