Please look my simple form in Stackblitz
https://stackblitz.com/edit/angular-et9uww
My form contains 2 checkboxes if I select one of the checkboxes it will populate one textbox. In my scenario, I have 2 checkboxes and 2 text boxes and one submit button.
NOTE- in my case i have n number of checkbox and child questions
Validation includes -> 2 textbox are mandatory
If the user submits the form without entering textbox it will show the error message.
STEP to Recreate
- check the checkbox1, textbox will appear without any error message
2.then submit the form it will show the error. that is fine.
- check the checkbox2, again new textbox will appear with error message without clicking submit button.
But I WANT that second error message display only if the user hit submit button again.
Thanks
|| angularForm.submitted. So, since the form has been submitted, the error message is displayed. If you don't want that, then don't show the error message when the form has been submitted.