-
Hello everyone, for this question, I need to provide a bit of context. I'm currently working on an experiment and have built a WebComponent that uses your package. I've integrated this web component into both an Angular and a React app. I'm using a Submit Button in the outer app (e.g., Angular app) and would now like to trigger the validations so that incorrect fields are marked in red (similar to when using the standard submit button). That is needed for required fields that have not been touched for example. Right now im just disable the Submit button while the form is not valid (what works perfectly) but i want to enable the button so that the user can press it and see what fields are not filled out but required. I already know how to trigger an event from outside the WebComponent, but I'm unsure how to trigger the validation for all fields so that the fields are marked in red. I tried using the handleSubmit method from useFormApi, but that didn't work out. Perhaps you could assist me once again. Best regards, |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hello, in most of our mappers, the validation is shown only when the field is blurred out (user clicked out of the field) to not scare users before they start updating values. If your components behave the same, you need to make them touched: update form state or just focus all of them. |
Beta Was this translation helpful? Give feedback.
-
@rvsia thank you :) ! |
Beta Was this translation helpful? Give feedback.
Hello,
in most of our mappers, the validation is shown only when the field is blurred out (user clicked out of the field) to not scare users before they start updating values. If your components behave the same, you need to make them touched: update form state or just focus all of them.