unpoly icon indicating copy to clipboard operation
unpoly copied to clipboard

Respect unpoly attributes on form submitters

Open WIGGLES-dev opened this issue 1 year ago • 2 comments

Bug description

the HTML form submit event has a submitter property on all modern browsers. Builtin up attributes such as up-target are not respected if present on the submitter.

Expected behavior

up attributes on submitter override attributes on form.

Additional context

Not a bug, but this would be a useful feature for anyone who likes to overload forms with lots of actions.

WIGGLES-dev avatar Dec 10 '23 23:12 WIGGLES-dev

I couldn't understand this. Can you provide examples?

triskweline avatar Dec 11 '23 08:12 triskweline

I couldn't understand this. Can you provide examples?

A form submitter is any button or input that is used to submit the form.

for example

<form>
<button formmethod="post" formaction="/press/button1">Press Me!</button>
<button formmethod="post" formaction="/press/button2">No Press Me!</button>
</form>

If up-target is specified on the submitter, in this case the button. It will not be respected.

WIGGLES-dev avatar Dec 11 '23 16:12 WIGGLES-dev