Multiple clicks create duplicate entry
When a form submit button is clicked multiple times, the form is being submitted multiple times and creating duplicate entries..
How to stop this behaviour...
5 Replies
I have also managed to replicate this. Throttling chrome using dev tools can make this easier to replicate. When the request is sent, the form submit is disabled but inbetween the form request finishing and a redirect happening the form can be resubmitted.
Found any way to avoid it... ?
Using a unique constraint on the db level in combination with database transactions could be one way to avoid the duplicate entry, but there may or may not be other caveats to it
This is basically how the solution is solved on our end from a back end perspective indeed. Some requests are passed through with a uuid that the database wont allow duplicates of, others just use unique where you'd expect. I didnt realise transactions could be enabled panel wide, but we've just wrapped stuff in a transaction where required.