Intro component with sign-up form || CSS-Grid, Vanilla JS
Design comparison
Solution retrospective
There are a lot of new things I'd learned throughout this challenge.
- Floating labels
- Dom Manipulation
- Form validation
- Form Data Process
- Passing a function as an argument
- Refactoring code.
In this case, when I clicked the submit button and all inputs are empty, I wanted the first error message to appear are "First Name is required", instead of "First Name at least 5 characters". So I remember we can pass a function as an argument, right? Then I create another statement inside a checkRequired() then pass a checkLenght() and checkEmail() as an argument, and it works as I wanted.
My question is, can you guys explain why it is working? I really didn't know what I'm doing I just intuitively pass that function into an else if statement but I really don't understand how it works.
Your feedback will be really appreciated guys.Thanks.
Community feedback
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