-- Enzo Labianca <[EMAIL PROTECTED]> wrote
(on Saturday, 12 April 2008, 12:16 AM -0700):
> my problem is: I've a form. After having submited its data, let's suppose
> that an element's value violates the primary key constraint of the table in
> which I'd like to store the data. So the database gives me an error message.
> How can I do for viewing this message like the error messages that apper
> when a form is not valid using isValid() method?

Your subject line indicates the answer: create a custom validator that
checks for this.

    class My_Validate_DbKey
    {
        public function isValid($value)
        {
            ... check if it violates constraints..
        }
    }

and then make sure you add this validator to your element.

-- 
Matthew Weier O'Phinney
Software Architect       | [EMAIL PROTECTED]
Zend - The PHP Company   | http://www.zend.com/

Reply via email to