Design comparison
SolutionDesign
Solution retrospective
Hello Everyone, This is my solution on the Intro Component with sign-up form component I completed the challenge and i implemented form validation on it I'd appreciate feedback and contribution on the project, especially concerning the Form Validation Functionality.
Thank you!
Community feedback
- @ArseniyXPosted over 1 year ago
Hello, good job. Design bugs:
- when wrong password or email format its show: * cannot be empty message instead of wrong format message
- first name and last name accepting numbers
Code to improve:
- You manipulating the DOM directly without any framework/library that aren't a good choice
- You doing complex condition like:
!firstName.classList.contains("error") && !lastName.classList.contains("error") && !email.classList.contains("error") && !password.classList.contains("error")
inside the if statement, you can put this logic to function name isValidForm or something and then use it in if statement.
- you use wrong convention for css vars --Red needs to be something like
--danger-color
or--error-color
let namePattern = /^[A-Za-z]+$/;
should be const from the context- remove unused comments like:
// inputFieldName.nextElementSibling.style.display = "block";
or add // TODO: if you wanna do something with that later
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