Swaz
331
15
Laravel

Preventing multiple submits

Posted 3 years ago by Swaz

Is there a simple way to globally prevent multiple submits. (ie. if the user clicks the submit button really fast, like 7 times in 1 second).

I know I could disable the button after the first click with JavaScript. But I would prefer a more solid back end solution. I could maybe generate a token on each page load and check if that token has been submitted already, but that would be tedious to go back and do that to all my forms. Any ideas? Or am I missing something here.

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.