-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
For the button element, make 'button' the default value for the type attribute (instead of 'submit') #9848
Comments
Unfortunately, I'm not sure you appreciate the amount of breakage end users would have to endure sufficiently. This is not a change we can make. |
Sorry to chime in on a closed topic, but I, too, have stumbled across this because I was looking for discussions about this (and I really don’t want to set But then there are, in my opinion, a few other points to consider:
I think that having a default behaviour that is dependant on something that is not mandatory (here: that the default makes only sense for a form) is bound to surprise people and lead to other problems; it feels like bad design for a standard. The fact that there are quite a few blog posts and question (e.g. the one from SO posted above) shows that the default is rather surprising in and of itself. The question, of course, is what could be done about this. As said, I appreciate the fact that actually globally changing the default behaviour as implemented in browsers will lead to a lot of problems.
Personally, I think that while solution 2 would be cleaner – in that different default behaviours, too, fell like bad design –, solution 1 might actually be the way to go. Just guessing, but for > 99% of web pages out there, that’s actually what happens (and is expected to happen) anyway. That would be minimum impact while still making the standard clearer and easing confusion. |
Forms can have multiple submit buttons, that's quite normal. And I'm not sure what you mean to suggest that outside of a form it would not be a submit button. It seems that would still require implementation changes for the |
@dariok Yes there are definitely options available to mitigate the effects of a widespread breaking change. Thanks for your interesting suggestions. At the end of the day that is "just a breaking change", and one that is easy enough to fix. I mean since when does a bad design need to stay there forever because it breaks stuff ? That reminds me of microsoft back in the nineties not wanting to fix IE because it would "break the web". There is ample discussion on the internet that proves the default behaviour is not well known and used erroneously by many. |
@annevk Very well, forms may have multiple submit buttons – but that was just a side node.
Just what I say: when not in a form, the default for the type would not be "submit" but "button".
Hm...
Should not be too complicated. |
What is the issue with the HTML Standard?
It seems that many developers find it weird that the default behaviour of a element is to submit the form when no type is specified. See this SO question as an illustration. Why not make the missing value default of the type attribute be 'button' instead of 'submit' as I feel it is more logical with the very nature of the button element ?
Now I appreciate that there is a backwards compatibility issue here, as it would break many websites which rely on the default submit behaviour, but medium to long term this makes more sense and is more consistent.
Sorry if this is a duplicate, I could not find any other one stating the same thing.
The text was updated successfully, but these errors were encountered: