Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted 9 months ago

Contact Form

accessibility, pure-css, van-js
Muhamad Rukhul Kirom•380
@rukhulkirom
A solution to the Contact form challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


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

I’m really proud of how the form validation is handled in this project. The JavaScript ensures a smooth user experience by providing real-time validation feedback, and the error handling feels intuitive. The toast notification for successful submissions adds a nice touch of interactivity, making the form feel polished and professional. Additionally, the UI design is clean and responsive, ensuring that it works well on different screen sizes.

One improvement I would make is refactoring the validation logic to be more modular and reusable. Right now, the validateGroup function covers multiple input types, but breaking it into smaller functions for each type could make the code cleaner and easier to maintain. I would also consider using a form library or built-in HTML5 validation features for better scalability.

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

Challenge:

Initially, managing validation for different input types (text, email, radio, checkbox, textarea) in a single function became messy. Some errors didn’t display correctly, and real-time validation wasn’t working smoothly.

Solution:

I structured the validation logic to handle each input type separately within the validateGroup function. I also implemented event listeners (click and blur) to provide immediate feedback when users interact with or leave a field.

What specific areas of your project would you like help with?
  1. Is my validation logic structured efficiently, or is there a better way to organize it?

  2. Would breaking down validateGroup into separate functions for each input type improve readability and maintainability?

  3. Are there additional ways to improve accessibility, particularly for screen reader users?

  4. Are there any optimizations I can apply to improve form performance, especially for handling validation?

Code
Loading...

Please log in to post a comment

Log in with GitHub

Community feedback

No feedback yet. Be the first to give feedback on Muhamad Rukhul Kirom's solution.

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

Stay up to datewith new challenges, featured solutions, selected articles, and our latest news

Frontend Mentor

  • Unlock Pro
  • Contact us
  • FAQs
  • Become a partner
  • Use cases

Explore

  • Learning paths
  • Challenges
  • Solutions
  • Articles

Community

  • Discord
  • Guidelines

For companies

  • Hire developers
  • Train developers
© Frontend Mentor 2019 - 2025
  • Terms
  • Cookie Policy
  • Privacy Policy
  • License