Skip to content
This repository has been archived by the owner on Dec 14, 2018. It is now read-only.

Button TagHelper for formaction #1668

Closed
yishaigalatzer opened this issue Dec 4, 2014 · 14 comments
Closed

Button TagHelper for formaction #1668

yishaigalatzer opened this issue Dec 4, 2014 · 14 comments

Comments

@yishaigalatzer
Copy link
Contributor

Initial suggestion - Need to fill in more details,

Scenario

A form with multiple buttons, that needs to go do different actions based on what was clicked.

<form ...>
    ...
    <button type="submit" formaction="/Album/Edit">Edit</button>
    <button type="submit" formaction="/Album/Delete">Delete</button>
</form>

A Tag helper look like

<button asp-action="Edit" asp-controller="Album" />

And Generate

<button formaction="Album/Edit" />

Similarly we can make these attributes also work on the input tag helper, when type is submit.

@yishaigalatzer
Copy link
Contributor Author

@Eilon
Copy link
Member

Eilon commented Jul 18, 2016

@DamianEdwards @danroth27 there seems to be some renewed interest in this (see #5034). Thoughts?

@DamianEdwards
Copy link
Member

Seems very simple to add and very useful. SOLD! Fit in 1.1?

@Eilon Eilon added enhancement 1 - Ready up-for-grabs Members of our awesome commnity can handle this issue labels Jul 18, 2016
@Eilon Eilon modified the milestones: 1.1.0, Backlog Jul 18, 2016
@Eilon
Copy link
Member

Eilon commented Jul 18, 2016

Marking as up-for-grabs in case anyone wants to try their hand at it.

@ctyar
Copy link
Contributor

ctyar commented Jul 19, 2016

Is this design final? if so I can give it a try

@Eilon
Copy link
Member

Eilon commented Jul 19, 2016

@ctyar well I'm not sure I'd call this exactly a design, it's more like some random thoughts people had 😄

But... it probably is fairly straightforward. We'd presumably want to do exactly what we do for stuff like the <form> tag and <a> tag as far as the tag helper attributes it should have, and the behavior it should have if there's an existing explicit formaction attribute defined on the tag.

If you want to take a crack at it, let us know, and send a PR when you're ready.

@ctyar
Copy link
Contributor

ctyar commented Jul 19, 2016

@Eilon yeah I found those two, I'm already on it

@Eilon
Copy link
Member

Eilon commented Jul 19, 2016

@ctyar sounds great, looking forward to see the PR! Thanks!

@Eilon
Copy link
Member

Eilon commented Aug 17, 2016

@dougbu, assigning to you because you're looking at @ctyar 's PR.

dougbu pushed a commit that referenced this issue Aug 30, 2016
dougbu pushed a commit that referenced this issue Sep 1, 2016
@dougbu
Copy link
Member

dougbu commented Sep 2, 2016

@dougbu dougbu closed this as completed Sep 2, 2016
@dougbu dougbu added 3 - Done and removed 2 - Working up-for-grabs Members of our awesome commnity can handle this issue labels Sep 2, 2016
@shaunluttin
Copy link

shaunluttin commented Dec 19, 2016

How can we use this new feature? It appears not to be part of any releases.

@DamianEdwards
Copy link
Member

It should be included in 1.1.0

@shaunluttin
Copy link

shaunluttin commented Dec 19, 2016

Aha. It is. Thank you @DamianEdwards... it is now under FormActionTagHelper.

@JackLama
Copy link

Code can read, that is, poor expression, continue to practice

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants