TIL: that the <button>
element in HTML5 will cause a form to submit when clicked (instead of any other behaviour you expect) because <button>
has a default value of, get this… type="submit"
.
You would think <button>
would have a default type of “button”, but no. Bloody hell lol.
This Stackoverflow answer saved me from further headaches.
@prologic@twtxt.net Surprisingly no. In my case I already had a regular <input type="submit">
in the form. It’s just the HTML5 spec, for some reason, that if a button has no type explicitly defined, it defaults to type="submit"
LOL 😅