Opened 7 days ago

Last modified 7 days ago

#28889 new Cleanup/optimization

Use JavaScript to prevent double submission of admin forms

Reported by: Manuel Saelices Owned by: nobody
Component: contrib.admin Version: 1.11
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: yes Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Manuel Saelices)

For fast clickers.

Change History (3)

comment:1 Changed 7 days ago by Manuel Saelices

Description: modified (diff)

Fixed on this Pull Request: https://github.com/django/django/pull/9425

comment:2 Changed 7 days ago by Aymeric Augustin

Triage Stage: UnreviewedAccepted

I think this is an improvement and the implementation looks reasonable.

comment:3 Changed 7 days ago by Tim Graham

Has patch: set
Needs tests: set
Summary: Prevent double submission on admin formsUse JavaScript to prevent double submission of admin forms
Type: BugCleanup/optimization

I found an article titled JavaScript: Preventing Double Form Submission which might be worth reviewing. In particular, it points out "Rather than simply disabling the button, we can also change the text so that people don't get confused."

Did you consider trying to add some tests for the patch?

I share Nick's concern on the pull request that this may have a good chance of causing some regression in unconsidered edge cases. I'm not sure if it's considered a best practice these days. The article suggests that some browsers (e.g. IE11) treat a double click as a single click. It seems unfortunate if every project has to add something like this.

Note: See TracTickets for help on using tickets.
Back to Top