-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Option to disable rendering name attribute to submit button #28964
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
Comments
I wonder why the extra fields error is thrown. Does this happen only when the form name contains a space? |
yes |
I think the issue here is that the |
@Ferikl So in your case the solution is to choose a name that does not contain spaces. |
I don't think this is a use case that is common enough to justify an option for this in the Form component. IMO to achieve this you rather need to make use of the form theming mechanism in your application to make sure that the attribute is not rendered |
This PR was merged into the 4.3-dev branch. Discussion ---------- [Form] deprecate using invalid names for buttons | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | yes | Tests pass? | yes | Fixed tickets | #28964 | License | MIT | Doc PR | Commits ------- 405aa54 deprecate using invalid names for buttons
Description
Add Possibility to not render name attribute to submit button (SubmitType).
Example
I want to create simple Search Form like this:
When I render my Form in template
I can see:
<button type="submit" id="Search By Tags" name="Search By Tags" class="btn-secondary btn">Search By Tags</button>
But I dont want to have &Search+By+Tags= in my URL after form submit and Error with message:
So my suggestion is to add some param/option to SubmitType::class or whatever to NOT render name="Search By Tags" attribute.
The text was updated successfully, but these errors were encountered: