Skip to content

Provide a new form component to simplify form authoring #49653

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

Open
danroth27 opened this issue Jul 26, 2023 · 5 comments
Open

Provide a new form component to simplify form authoring #49653

danroth27 opened this issue Jul 26, 2023 · 5 comments
Labels
area-blazor Includes: Blazor, Razor Components enhancement This issue represents an ask for new feature or an enhancement to an existing one feature-blazor-component-model Any feature that affects the component model for Blazor (Parameters, Rendering, Lifecycle, etc) Pillar: Complete Blazor Web
Milestone

Comments

@danroth27
Copy link
Member

danroth27 commented Jul 26, 2023

When I tried to implement a logout form, this is what I ended up with:

<form method="post" @onsubmit="Logout" @formname="logout">
    <button type="submit">Logout</button>
    <AntiforgeryToken />
</form>

It didn't make sense to use EditForm for this form because EditForm requires a model or an edit context, which I don't really need.

A couple of observations:

  • I had to explicitly specify a form name, which is now required for all forms
  • I had to manually add antiforgery support

In Razor Pages the form tag helper handles these concerns for you:

<form asp-page="/Identity/Account/Logout" method="post" >
    <button type="submit">Logout</button>
</form>

Should we provide a new framework component that makes authoring these sorts of forms easier?

@ghost ghost added the area-blazor Includes: Blazor, Razor Components label Jul 26, 2023
@javiercn javiercn added Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. and removed Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. labels Jul 27, 2023
@dotnet dotnet deleted a comment Jul 27, 2023
@mkArtakMSFT mkArtakMSFT added the enhancement This issue represents an ask for new feature or an enhancement to an existing one label Jul 27, 2023
@mkArtakMSFT mkArtakMSFT added this to the Backlog milestone Jul 27, 2023
@ghost
Copy link

ghost commented Jul 27, 2023

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

@mkArtakMSFT mkArtakMSFT added the feature-blazor-component-model Any feature that affects the component model for Blazor (Parameters, Rendering, Lifecycle, etc) label Jul 27, 2023
@Bartmax
Copy link

Bartmax commented Sep 23, 2023

Also I find impossible to submit a normal (not enhanced) form post now (for example for cookie auth) in RC1.

@danroth27
Copy link
Member Author

Also I find impossible to submit a normal (not enhanced) form post now (for example for cookie auth) in RC1.

Hi @Bartmax. This sounds like something we should investigate. Could you please open a new issue for this with details on how to reproduce the issue?

@Bartmax
Copy link

Bartmax commented Sep 25, 2023

Hey @danroth27, the issue of not able to do a normal (full page) post in a form on RC1 (without turning the whole thing off) is already taken care on RC2 with a way to individually opt-in/opt-out of enhance navigation on forms/links.

I still do find that solution problematic, so I did open an issue for that here #50887

@ghost
Copy link

ghost commented Dec 20, 2023

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

@dotnet-policy-service dotnet-policy-service bot added the pending-ci-rerun When assigned to a PR indicates that the CI checks should be rerun label Feb 6, 2024
@wtgodbe wtgodbe removed the pending-ci-rerun When assigned to a PR indicates that the CI checks should be rerun label Feb 6, 2024
@dotnet-policy-service dotnet-policy-service bot added the pending-ci-rerun When assigned to a PR indicates that the CI checks should be rerun label Feb 6, 2024
@wtgodbe wtgodbe removed the pending-ci-rerun When assigned to a PR indicates that the CI checks should be rerun label Feb 13, 2024
@dotnet dotnet deleted a comment from dotnet-policy-service bot Feb 13, 2024
@dotnet dotnet deleted a comment from dotnet-policy-service bot Feb 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-blazor Includes: Blazor, Razor Components enhancement This issue represents an ask for new feature or an enhancement to an existing one feature-blazor-component-model Any feature that affects the component model for Blazor (Parameters, Rendering, Lifecycle, etc) Pillar: Complete Blazor Web
Projects
None yet
Development

No branches or pull requests

5 participants