3 ms·
it's not a lazy hack, but a useful indication to the user that his action has an effect. Besides double submit there is also an issue of a single sumbit - have
by eviks 3y ago
it's not a lazy hack, but a useful indication to the user that his action has an effect. Besides double submit there is also an issue of a single sumbit - have I actually clicked on the button or somewhere nearby or never properly clicked or has something else, pardon the pun, not clicked?
- withinboredom 3y agoWorse is when the request fails but the JS written doesn't know how to handle that and now I can't try again.
- moritzwarhier 3y agoYou imply that this is the only possibility to provide user indication for a form submit - why? What about some stupid text below the button: "Your data is being submitted..."? Seems the meat of the argument is the disabling behavior, which is really trivial to implement in JS. When I want to submit a form and the button changes to a regular grayed-out disabled button on click, on top of that without a page reload, I'd assume something went wrong. You need to distinguish "disabled" from "action in progress" any way, by using a bit of special casing and CSS polish for the "submitting disabled" button... in which case, why use the disabled attribute at all, instead of preventing submit in JS? It's not harder compared to toggling attribute in JS.
- eviks 3y agoI don't imply that, you can add some text, it would still not make the original fundamental UI feedback benefit disappear and make it a lazy hack. The text is ok as an addition, but worse as a substitute - the feedback should be a property of the UI element you interact with. > , by using a bit of special casing and CSS polish for the "submitting disabled" button.. or by simply adding a different label to the now disabled button? > why use the disabled attribute at all to get the same outcome in a simpler manner? But if you recreate all the pieces with in an alternative way, that's fine, don't toggle the attribute
- moritzwarhier 3y ago> I don't imply that, you can add some text, it would still not make the original fundamental UI feedback benefit disappear What original fundamental feedback? The default disabled style of a form button is not what a button should change to after submit?