Design comparison
Solution retrospective
How can I show the error messages in the form, can you help me?
Community feedback
- @LucianoDLimaPosted over 1 year ago
Hey, good job on finishing this challenge!
About your question, there are a few ways of going about it. One of them would be to create a css class that has
display: none;
inside, and then you add it to the error message, that way it won't show up. Then you make a trigger in js so that whenever there's an input error, the class is added to the error message, that way the message will appear, then if the user writes the correct information, the class is removed again.Hope it makes sense! Happy coding!
Marked as helpful1@ayberkkkPosted over 1 year ago@LucianoDLima Thank you very much for your suggestion, I will try that. I tried to print <span class="err-text"></span> by assigning the err-text class in the Javascript part, but there was only one message, so I removed the messagge feature.
0
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord