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

Made using react

Nikesh W 170

@randomduckduck

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?

Made using react, proud of that.

For error handling I tried using different things form internet (installing many packages, trying different things out) but they were quite a hassle. Instead made my own validation function, using already provided validity flags by vanilla js and it works perfectly without hassle.

Also got to know how to use css to affect parent when child has some behavior.

For example, say we have div->div->input. now if we wanted outermost div to change border-color when input:valid and when input:invalid. For this we can use div:has(input:valid) or div:has(input:checked) to now change border for outermost div. Pretty cool actually

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

I had made the error handling using css (which worked correctly, showing error for invalid input, hiding error when input is valid using :valid and :invalid selecors) but had to use js ultimately as I could not do anything using css for following problem

  • first load, errors would be showns as :invalid selector kicks in for empty input too

So had to use js functions to handle errors eventually

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