Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: support overriding form behavior from submitter element #54

Closed
1 of 3 tasks
daun opened this issue Aug 18, 2023 · 0 comments · Fixed by #55
Closed
1 of 3 tasks

Feature: support overriding form behavior from submitter element #54

daun opened this issue Aug 18, 2023 · 0 comments · Fixed by #55

Comments

@daun
Copy link
Member

daun commented Aug 18, 2023

Describe the problem

HTML allows overriding the form action, method and target from the submit button itself. Clicking the first submit button will submit a GET request, clicking the second button will submit to /search:

<form action="/" method="POST">
  <input type="submit" formmethod="GET" value="Submit as GET">
  <input type="submit" formaction="/search" value="Submit to /search">
</form>

Describe the proposed solution

Check for the SubmitEvent's submitter property and deduce the final form behavior from there, if present.

Alternatives considered

None, really, if we want to comply to current standards

How important is this feature to you?

  • Nice to have
  • Would make my life a lot easier
  • I cannot use swup without it
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant