Design comparison
Solution retrospective
Any feedback is welcome! especially about javascript. Because, I'm new learning that language.
Community feedback
- @vanzasetiaPosted almost 2 years ago
Hi, Patosinsuerte! 👋
For JavaScript, I recommend doing the following things.
- Remove
letterReg
. You should only make sure that the first name field and the last name field are not empty. It is possible for a human to have one letter for the first name. The same goes for the last name. - Remove
passReg
. Password rules are making it hard for users to create a password, especially for someone that is using a password manager (it's me). I recommend only making sure that it has at least 8 characters long. Users should be able to input any characters. - Only the form should have an event listener.
- Use triple equals instead of two equals for strict validation.
I wrote an article that takes a deep dive to create an accessible form. I recommend reading it to help you improve this solution—more importantly getting the HTML right.
How To Create Accessible Form with Boring Design? - CodeNewbie Community 🌱
I have a question. Why are you prefixing the variable names with
$
? I never see such a naming convention.I hope this helps. Have fun coding! 😄
Marked as helpful0@pabarcagPosted almost 2 years ago@vanzasetia Thanks for the recommendations, I really appreciate them. I use the $ sign to identify variables that contain DOM elements. But, maybe it's bad practice, idk
0@vanzasetiaPosted almost 2 years ago@Patosinsuerte
You are welcome!
I don't know if that is a bad practice. It is just something that I never see before. 🙂
0 - Remove
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