Skip to content

[up-validate] Submits to the wrong URL when form contains multiple submit buttons with [formaction] attributes #460

@sturatcliffe

Description

@sturatcliffe

Bug description

Hey,

A lot of our forms have multiple submit buttons which submit the form to different endpoints for different actions.

However, this then breaks the [up-validate] behaviour because the validation submissions aren't sent to the action on the form, but rather one of the [formaction] attributes from the other submit buttons. I've never used Glitch before so haven't implemented any server logic, but there's a very minimal repro here:

https://vigorous-local-akubra.glitch.me/

If you focus the input, then tab out of it and check the browser network tab you can see that it submits to the wrong URL.

Expected behavior

[up-validate] should be submitted to the default action of the form.

Browser version

  • OS: Windows 10
  • Browser: Chrome
  • Version 110.0.5481.177

Additional context

Unpoly v2.7.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions