8000 [Form] Ability to clear form errors by colinodell · Pull Request #5152 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

[Form] Ability to clear form errors #5152

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Documentation on the new clearErrors() method
  • Loading branch information
colinodell committed Apr 6, 2015
commit 6abe3e46d584cb0873d392993b09feb5aa140c91
7 changes: 7 additions & 0 deletions components/form/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -697,6 +697,13 @@ method to access the list of errors. It returns a
This is useful, for example, if you want to use PHP's ``array_`` function
on the form errors.

Clearing Form Errors
~~~~~~~~~~~~~~~~~~~~

Any errors can be manually cleared using the :method:`Symfony\\Component\\Form\\FormInterface::clearErrors`
method. This is useful when you'd like to validate the form without showing validation errors to the user
(i.e. during a partial AJAX submission or :ref:`dynamic form modification <cookbook-form-dynamic-form-modification>`).
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could anyone please provide some guidance on how I'd link to this cookbook article? Apparently I've done it incorrectly :-/

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like you want to do the following:

:doc:`dynamic form modification </cookbook/form/dynamic_form_modification>`


.. _Packagist: https://packagist.org/packages/symfony/form
.. _Twig: http://twig.sensiolabs.org
.. _`Twig Configuration`: http://twig.sensiolabs.org/doc/intro.html
0