How do I delay before resubmitting a form?
You can simply write the date and time through localStorage and compare.Anonymous
For simple cases, localStorage is fine, but what is easy to create is easy to break off.
For more complex cases, you need to look at the requirements.
For example, if a user is authorized before sending a message, then the most reliable is, for example, in a radish, to put information that a user has recently posted in such and such a thread. The key's lifetime will determine the duration of the prohibition on re-commenting.
For the case when the user can remain unauthorized - you need to think. What exactly is worth blocking is a direct entry to the form using the link. The need to request several pages from the site, and even in a certain order, will at least slightly complicate the life of a potential spammer.Anonymous
To place the code, please use CodePen or similar tool. Thanks you!