4 ms·
To clarify, I don't think HTML should be expected to be responsible for button styling – that is a CSS concern. But I was really more responding to the "why can
by kypro 3y ago
To clarify, I don't think HTML should be expected to be responsible for button styling – that is a CSS concern. But I was really more responding to the "why can't I do this with a HTML library" comment, which you can but with a JS library instead. And while it's true HTML has some dynamic elements the assertion that you should be able to build advanced dynamic behaviour like this in HTML alone I think misunderstands the purpose of HTML. JS was built for more advanced dynamic behaviour, and you can absolutely do what the parent commenter is asking for with a JS library.
To defend my suggestion of a "singleSubmit" attribute – I think the form element itself which already has the ability to do some basic dynamic stuff like submit a form in various ways could reasonably include the basic requirement of not allowing said form to be submitted twice. Personally this isn't something I think is a huge issue because most of the time when we'd want to do this we're looking to build fancy dynamic form behaviour anyway and in those cases JS is going to be what you need to use for that. But there are some simple webpages out there which don't care about any of that fancy stuff and literally just want a form on a page which POSTs data to another page, and in those cases it would be nice to have the "singleSubmit" attribute I suggested.