tags:

views:

160

answers:

1

Hi,

in a form if there is a field and a global error both messages are showed.

I would like to show the global errors only if there isn't any field error.

Any idea?

Javi

+1  A: 

This snippet should do the job

<?php if (0 == count($form->getErrorSchema()->getErrors())):?>
<?php echo $form->renderGlobalErrors()?>
<?php endif?>
develop7
Sooooorrry...what works is this: <?php $total_num_errors = count($form->getErrorSchema()->getErrors()); $global_num_errors = count($form->getErrorSchema()->getGlobalErrors()); if (0 == $total_num_errors - $global_num_errors):?> <?php echo $form->renderGlobalErrors()?> <?php endif?>
anyway you got an idea, right?
develop7