Missing form tag attribute
Klaus-Peter Wegge <[email protected]>
| Newsgroups | gmane.comp.web.lynx.devel |
|---|---|
| Message-ID | <[email protected]> |
Dear Lynx dev team,
# Missing Form Tag Attribute
HTML5's button [formaction attribute]
https://www.w3schools.com/tags/att_button_formaction.asp
allows for buttons to point to another endpoint different than what main
form specifies. This way it is possible to avoid having lots of forms for
simple actions instead of just one big one, but currently CLI browsers such
as lynx ignore this attribute and try to send wrongly
data to form's main endpoint.
Example:
```html
<form action="/main_action" method="post">
<!-- ......... -->
Item1<button type="submit" formaction="/remove_action?item1">Remove</button>
Item2<button type="submit" formaction="/remove_action?item2">Remove</button>
Item3<button type="submit" formaction="/remove_action?item3">Remove</button>
<!-- ... -->
</form>
```
The above example, buttons should send form data to /remove_action instead
of /main_action, the current and only workaround in html is as stated
before, one form per possible action like:
```html
<form action="/main_action" method="post">
<!-- ......... -->
</form>
<form action="/remove_action?item1" method="post">Item1<button type="submit">Remove</button></form>
<form action="/remove_action?item2" method="post">Item2<button type="submit">Remove</button></form>
<form action="/remove_action?item3" method="post">Item3<button type="submit">Remove</button></form>>
<!-- ... -->
</form>
```
Which is suboptimal and hurts performance.
# Specification of Attribute
* https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#attr-fs-formaction
Is it possible to improve lynx by supporting this attribute?
Many thanks
Klaus