From 06e88696d7b2b8764bef30b99a1363a202659790 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Wed, 25 Sep 2019 10:55:08 +0200 Subject: [PATCH] clarify constraints on non-submitted forms --- form/without_class.rst | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/form/without_class.rst b/form/without_class.rst index a1c441f494a..330e616eaa4 100644 --- a/form/without_class.rst +++ b/form/without_class.rst @@ -75,7 +75,7 @@ But if the form is not mapped to an object and you instead want to retrieve a simple array of your submitted data, how can you add constraints to the data of your form? -The answer is to setup the constraints yourself, and attach them to the individual +The answer is to set up the constraints yourself, and attach them to the individual fields. The overall approach is covered a bit more in :doc:`this validation article `, but here's a short example:: @@ -112,3 +112,9 @@ but here's a short example:: If the form is not mapped to an object, every object in your array of submitted data is validated using the ``Symfony\Component\Validator\Constraints\Valid`` constraint, unless you :doc:`disable validation `. + +.. caution:: + + When a form is only partially submitted (for example, in an HTTP PATCH + request), only the constraints from the submitted form fields will be + evaluated.