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

Component: Button cannot be associated with form #13897

Closed
pclancy opened this issue Oct 17, 2023 · 6 comments
Closed

Component: Button cannot be associated with form #13897

pclancy opened this issue Oct 17, 2023 · 6 comments
Labels
Status: Discussion Issue or pull request needs to be discussed by Core Team Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible Type: New Feature Issue contains a new feature or new component request

Comments

@pclancy
Copy link

pclancy commented Oct 17, 2023

Describe the feature you would like to see added

The p-button control should expose a Form property.

Is your feature request related to a problem?

The p-button control does not expose a Form property. It won't be possible to associate a Form with a submit button which is useful when adding Submit buttons into separate templates (e.g. footer in dialog or side panel)

e.g. Dialog content

<form id="myform"></form>

e.g. Dialog footer

<ng-template pTemplate="footer"> <p-button type="submit" form="myform" label="submit"></p-button> </ng-template>

Describe the solution you'd like

p-button needs to expose a Form prop as per https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#form

The element to associate the button with (its form owner). The value of this attribute must be the id of a <form> in the same document. (If this attribute is not set, the <button> is associated with its ancestor <form> element, if any.)

This attribute lets you associate <button> elements to <form>s anywhere in the document, not just inside a <form>. It can also override an ancestor <form> element.

Describe alternatives you have considered

Falling back to a standard button with the pButton directive.

Additional context

No response

@pclancy pclancy added Status: Discussion Issue or pull request needs to be discussed by Core Team Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible Type: New Feature Issue contains a new feature or new component request labels Oct 17, 2023
@RFretwell
Copy link

Nothing major to add to the discussion other than I've also just run into this as a problem.

@fhcj2
Copy link

fhcj2 commented Jun 13, 2024

Me too :/

@matteocusinato
Copy link

Me too 👍

@JamesTheTerry
Copy link

Same issue here :/

@luber
Copy link

luber commented Oct 30, 2024

+1

@mertsincan
Copy link
Member

Please use PrimeNG discussion channel for the new feature. Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Discussion Issue or pull request needs to be discussed by Core Team Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible Type: New Feature Issue contains a new feature or new component request
Projects
None yet
Development

No branches or pull requests

7 participants