-
Symfony version(s) affected7.0.7 DescriptionHello. When I have a form and I have defined validation for this form, when I press the submit button repeatedly, the error is displayed as many times as the button is pressed! How to reproducetwig:
controller:
Possible SolutionNo response Additional ContextNo response |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
I checked now that in every form I have on the site, if I complete the fields and press the submit button 50 times, for example, a comment will be entered on the site 50 times or a post will be placed on the site 50 times, and when you check the database I see that 50 posts are placed in it. I followed all the things from CSRF, form submission type and validations. How can I fix this problem? |
Beta Was this translation helpful? Give feedback.
-
Hello, you just discovered the infamous “double submit problem”. The usual work-around is to disable the form one way or another once it’s submitted; see https://www.bram.us/2020/11/04/preventing-double-form-submissions/ e.g. |
Beta Was this translation helpful? Give feedback.
Hello, you just discovered the infamous “double submit problem”. The usual work-around is to disable the form one way or another once it’s submitted; see https://www.bram.us/2020/11/04/preventing-double-form-submissions/ e.g.