Design comparison
Solution retrospective
Hello community!
All comments and improvements are encouraged and welcomed!!! :)
Have a great day!
Community feedback
- @palgrammingPosted over 3 years ago
so on a fresh page load [email protected] passes your email validation test then if you remove the .com and submit again it fails BUT THEN if you type the .com and submit again then it still fails
so you email validation logic still needs a little work
1@luibernipPosted over 3 years agoHello @palgramming , thank you for reviewing my code and helping me in this journey. I noticed what you said and tryid to change the code with a new else in the checkInput function.
function checkInput() { const emailValue = email.value.trim(); if (!emailValue) { setErrorFor(email, 'Whoops! It looks like you forgot to add your email'); } else if (!isEmail(emailValue)) { setErrorFor(email, 'Please provide a valid email address'); } else { alert('Success'); email.value = ''; } }
I'm not quite sure on what is the most appropriate way to see if it is working or not. But I think it works. If you have time I would be thankful with you if you can try it one more time.
Thanks
0@palgrammingPosted over 3 years ago@luibernip yes the problem I see is that in your success logic you are not removing the error status if it was previous set but you have made progress
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