News for hackers. Stuff that matters.
Re:Don't Disable Buttons by eviks on Wednesday November 08, 2023 @01:33PM (#38194780)
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?
Re:Don't Disable Buttons by withinboredom on Wednesday November 08, 2023 @03:55PM (#38196849)
Worse is when the request fails but the JS written doesn't know how to handle that and now I can't try again.
Re:Don't Disable Buttons by moritzwarhier on Wednesday November 08, 2023 @05:15PM (#38197923)
You 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.

Re:Don't Disable Buttons by eviks on Thursday November 09, 2023 @02:16AM (#38202075)
I 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

Re:Don't Disable Buttons by moritzwarhier on Saturday November 11, 2023 @12:55PM (#38232640)
> 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?