Monday, September 24, 2012

Hide Errors at Top of the Embed Form in Symfony

If you use embed forms, you will realise that the validatation errors appear twice, once near the input fields (in the embed form) and once at top of the embed form. To solve this....

I'm using the jroller plugin to generate auto admin:

plugins / sfAdminThemejRoller / data / generator / sfDoctrineModule / jroller / template / templates / _form_field.php

Use this (my solution):

    [?php if ($form[$name]->hasError() && get_class($form[$name]) != 'sfFormFieldSchema'): ?]
        [?php echo $form[$name]->renderError() ?]
    [?php endif; ?]

No comments:

Post a Comment