lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Lynx-dev] Missing formaction attribute


From: Zenlima
Subject: [Lynx-dev] Missing formaction attribute
Date: Mon, 04 Nov 2024 12:53:08 +0100

Hello,

I like to get your thoughts about the currently not support formaction
attribute in lynx. Our hope is that it will be supported in lynx.

H. 

## Motivation

Developing web applications that respect also text browsers w/o
javascript support; in particular for accessebility.

## Description

HTML5's button formaction attribute allows for buttons to point to another 
endpoint different than what main form tag 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, links, elinks, etc ignore this 
attribute and try to send data wrongly 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 is 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>
<!-- ... -->
</form>
```

Which is subobtimal for the application development and hurts performance.

## Specification of Attribute

 * 
https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#attr-fs-formaction






reply via email to

[Prev in Thread] Current Thread [Next in Thread]