Tutorial :triggering invalid message with zend_dojo elements on post fail



Question:

I am having a few issues with a Zend_Form that I have which uses Dojo elements to handle user validation.

The scenario is when are user fills in the form the dojo elements ensure the formatting is correct. On post of the form if there is an error such as the email address already existing in the database, my code throw an exception that I catch, I want to then use the dojo validation to display the error rather than having error messages at the top or bottom of the form.

I've tried the following:

catch(Exception $e){    $signupForm->populate($formData);    $signupForm->getElement('email')->setInvalidMessage('email addresss already exists');    $this->view-form = $signupForm;  }  

This redisplays the form but does not highlight the dojo element to show what element is failing. How can this be done or am I going to have to display the error messages somewhere on the form in an list?

Any help would be gratefully received.


Solution:1

Did you take a look at Zend_Dojo_Form?


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »