Design comparison
Community feedback
- @DonUggioniPosted over 2 years ago
Hey there,
Seems like your js file is missing some code?!
No errors show up when I leave the inputs empty or use an invalid email address.
Also, for email validations, at least client side, you should use some validation form to make sure the format is correct before submitting.
Hope it makes sense.
Marked as helpful1@mohit1607Posted over 2 years ago@DonUggioni Thanks for noticing it and can you tell me what is the easiest way to validate the form as I am new to vanilla js
0@DonUggioniPosted over 2 years ago@mohit1607 For the email validation you can use a regex, you can google it and tons will show up, find one and create a function to compare that to the email format.
As for the other inputs, you basically have to create conditions, or if statements, if the condition is not met, you add some error class to the field with the error message as specified in the design.
Have a look at my solution for this challenge to have an idea of the logic if you wish.
Hope it helps!
Marked as helpful1
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