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

Contact form with validation

Konrad 370

@konradbaczyk

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 challenges did you encounter, and how did you overcome them?

The biggest challenge was trying to catch every single error. I had problem with set JS functions to block submit form with any error. Finally form works well, it's impossible to submit form with error. I've learned more about forEach() function.

Community feedback

@IvanFdez01

Posted

Hi,

That's an excellent JS code in mi opinion, at this level at least. If I had to make an adjustment in the part where you mentioned you would struggle (how to block Submit when errors exist), I would carry a boolean, either globally or through parameters, across all five functions. If in checkErrors() the value is false, then don't allow Submit. This way, you avoid looping in checkErrors().

I know it's not a big deal, but time costs can become important when working with larger data.

Cheers, great job.

1

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