Closed signebedi closed 9 months ago
Disable Submit buttons onClick to minimize data spamming I noticed that double-clicking form submit buttons created a frustrating issue in production where form data was submitted twice to the server. I think that the problem is related to my mongodb wrapper class, not necessarily other backend tools like SQLAlchemy... but I'd like to impose a few front end fixes to help remediate the problem.
Improve MongoDB wrapper server side duplicate validation
Right now, the mongo wrapper library makes it easy for duplicate requests to make it through. We should fix this by adding some sort of validation to ensure that a duplicate has not been submitted, maybe based on the form configuration (eg. a default form config value where _allow_rapid_duplicates
defaults to False)
I have a hunch that we can solve this by disabling hte submit button after the first click, see https://stackoverflow.com/a/74540125/13301284.