'in angular how to submit form on click on radio button
I'm using angular 13 for my project. I want to submit a feedback form by using the radio button. I don't want to give a specific button for submission.
Solution 1:[1]
If you put a this on your form tag:
<form ... #myForm (submit)="mySubmitFn($event)">
You could make use of the (change) or (input) on the input:
<input ... (change)="myHandler($event, myForm)" />
Within the handler you could make some check on the value if needed, and submit your form.
Alternatively, if no check is needed, instead of calling myHandler you could just:
<input ... (change)="myForm.submit()" />
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Plabbee |
