Design comparison
Solution retrospective
Still unsure of best practices when styling input validity. As of now it works but I had a few uncertainties:
- adding the error icon. I just used the first thing that seemed to work
- when valid/invalid styles should be applied and how aggressive to be in alerting the user of errors
Community feedback
- @Shiba-TatsuyaPosted over 1 year ago
The function name checkValidInput is clear and descriptive, which makes it easy to understand its purpose. The use of querySelectorAll and forEach to iterate over each input is efficient and concise. The use of addEventListener to detect input events and invalid events is a good approach to handle user input. The use of CSS classes to visually indicate the validity of the input and to show the warning message is a good practice to separate the concerns of styling and functionality. The code is properly commented, which helps to understand the intention of each section of the code. Overall, the code looks well-structured and easy to read. It uses best practices for handling form input validation, and the code is well-commented. Good job! 👍
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