Please enable / Bitte aktiviere JavaScript!
Veuillez activer / Por favor activa el Javascript![ ? ]
When validating the fields manually how to display all the validation errors collection right? - bug-code.com Q&A

When validating the fields manually how to display all the validation errors collection right?

0 like 0 dislike
18 views
https://symfony.com/doc/current/validation.html

At the moment, say there is a field email, he has 5 conditions, if the user broke 3 clicks to submit the form, it returns an error at the first validation error. That is, he makes changes, again submits the form, and then the new, so 3 times for each error.

How can I fix it?

If 2 fields, it providerwhat 2 fields, but each field with one error. Need srazu outputs all errors to a field, i.e., field blank, field must be a email field must be of length xxx, etc. Because now the user is required each time to submit the form on the new until you fix all the errors.
It is strange that there solve the opposite problem https://github.com/symfony/symfony/issues/20017

Similar
\rhttps://stackoverflow.com/questions/42469466/symfo...
asked by | 18 views

2 Answers

0 like 0 dislike
Well, for example, to create in response to the errors array that will be filled by each validator for each field, just the problem of course is that a validator that returns an error, stop further execution of the program, but you try to think of the wrapper on it, and providerwith all possible fields, if of course, has no ready-made solutions
answered by
0 like 0 dislike
Call the validator a few times, one call on one rule each field. Then glue the result.

To do it staff methods seems to be impossible.
answered by
Welcome to Bug-code Q&A, where you can ask questions and receive answers from other members of the community.

24.8k questions

46.2k answers

0 comments

13.3k users

24,788 questions
46,220 answers
0 comments
13,321 users