I prefer to display form validation errors at the top of the form
rather than under each form field. I would also like to display only
one error at a time. I have the following code at the top of my form:
<?php
if ($form->isFieldError('user_username')){
echo $form->error('user_username');
} elseif ($form->isFieldError('user_password')) {
echo $form->error('user_password');
} elseif ($form->isFieldError('user_given_name')) {
echo $form->error('user_given_name');
} elseif ($form->isFieldError('user_surname')) {
echo $form->error('user_surname');
} elseif ($form->isFieldError('user_email')) {
echo $form->error('user_email');
}
?>
How can I move the nested if statements out of my view? Thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---