Deepak• 190
@itsdevdeepak
Posted
There are basally 3 patters to handle error states.
- Live validation errors: In this approach error state will visible as user type.
- Show error state after input is unfocusable: like the name show the input error state after user provides the value and leaves the input focus.
- Show the error state for all the input fields after user click on submit button.
You could use css class and add/remove it depending on your validation or you could also use ternary operator to hide or unhide the element. for validation use you could use regex or manual validation.
you can read more from this article
If you have any questions feel free to leave below.
0