Re:A contribution to the wild-bug-hunt-story genre
by de46le on Saturday August 10, 2024 @10:55AM
(#41209956)
A button doesn't have to be inside a form, though. You could have an empty form as a neighbour to the button (or anywhere else inside the page body), and associate the button with it.
No layout implications that way, barring any nth-child css (solvable by putting the form somewhere else). Doesn't solve the form being limited to GET/POST, but styling concerns are atleast handled.
[ Parent
| on HN ]
Re:A contribution to the wild-bug-hunt-story genre
by recursivedoubts on Saturday August 10, 2024 @01:24PM
(#41210896)
doable but rarely used, inconvenient and awkward, alex proposes allowing buttons to be stand-alone hypermedia controls which also allows multiple buttons located within a form to perform different actions (e.g. save v. cancel)
Re:A contribution to the wild-bug-hunt-story genre
by de46le on Saturday August 10, 2024 @03:12PM
(#41211548)
Oh for sure, standalone elements would definitely be better, I just wanted to point out that there's a way around needing to do silly stuff like <form class=blabla>
Though in my experience, it's great in frameworks like svelte. Define your forms at the top of the component, and you can see at a glance what native actions the component can do, and where it posts to.