Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Efficient error management with JS using DS. Success alert 2s long.

@IvanFdez01

Desktop design screenshot for the Contact form coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
2junior
View challenge

Design comparison


SolutionDesign

Solution retrospective


What are you most proud of, and what would you do differently next time?

Having a compact JS code. DS have a lot of potential, in my opinion, not only reducing asymptotic ejecution time costs, but enhancing readability. Also, with larger projects in mind in a future, it's a must to take care of the code.

What challenges did you encounter, and how did you overcome them?

It is necessary to establish regular expressions. They are very commonly used for validating the requirements of each field in forms. I first started looping over the input.value, having lots of booleans (e.g. for the email: one for the @, other for the dot...), etc. That's completely unfeasible. So I found these expressions that save a lot of work, for example for the email format: /^[^\s@]+@[^\s@]+\.[^\s@]+$/

Community feedback

Please log in to post a comment

Log in with GitHub
Discord logo

Join 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