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.

Laracasts Mascot

Hi, Have We Met Yet?

Did you know that, in addition to the forum, Laracasts includes well over 1000 lessons on modern web development? All for the price of one lunch out per month.

Sign Me Up


Reply to

Use Markdown with GitHub-flavored code blocks.