3 ms·
That's probably because HTML wasn't intended to be the part where you prevent against double submission. The backend should probably handle that.
by contravariant 3y ago
That's probably because HTML wasn't intended to be the part where you prevent against double submission. The backend should probably handle that.
- merb 3y agoHttp Post was not designed to be Idempotent so, basically you either fix double submission or your post starts to be Idempotent, which is basically against the spec (it’s not directly against it, but put would be preferred in that case). Of course you can always add an uuid hidden field and do upsert instead of insert/update. But such things are way harder to do.
- contravariant 3y agoHad things gone differently you could tell your form to use a put. Not sure if that works in current browsers. Either way you'd need to validate the input in the server side anyway. What are you going to do if the user (agent) misbehaves? Reddit frequently has this problem with comments popping up lots of times because of a shaky connection, and frankly I dislike letting data quality rely on your users behaving as you expect.
- definitelyauser 3y agoEven if it's handled in the backend, if you receive zero visual feedback from clicking the button, you'll just keep spamming it until something happens. Not that great of an experience when you sit there and "nothing happens".