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

Contact-Form

Tuna Erten•430
@tunaerten
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 struggled quite a bit with styling radio buttons and checkboxes, but after some research, I think I’ve figured it out. Other than that, I didn’t face many challenges. I realize now that I should plan and write the error messages in the initial HTML structure next time. Since I didn’t do that, I had to rewrite the code from scratch. Nevertheless, it was an enjoyable project. I’d appreciate any advice you can offer!

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • Asilcan Toper•2,960
    @KapteynUniverse
    Posted 8 months ago

    Merhaba Tuna, good job. I was thinking about going back an redo this challenge, now looking back i did a poor job back then :D.

    Since you wrote the method on the form; get is not correct, get is to request data from somewhere like an api, post is the one you should use. Post is to send data to a server to create/update a resource.

    Fieldset is to group related elements in a form, i think you can remove fieldset around the queries and change query-type div to a fieldset, legend also should be a direct child of the fieldset so it will be corrected with this way too. If you want, you can also wrap fname,lname and e-mail with a fieldset too i think.

    A little bug; because of the positioning of the custom checkbox it is not possible to uncheck the consent button, you have to click either the label or a little to the left to the white space.

    You can easily change the radio and checkbox color with this. This kinda broke your radios in your code tho but checkbox works, might need to change somethings if you wanna use it

    input[type="radio"]:checked, 
    input[type="checkbox"]:checked {
        accent-color: color;
    }
    

    This doesn't required if you have backend validation but i like frontend validations. You can put required attribute to the inputs, also autofocus to the first name for better accesibility. On a real page tho, contact forms usually be at the below of the page under other things, so autofocus might do harm than good in that scenario. There are also nice ways of styling the inputs and elements around them with frontend validation, for example it is possible to show error messages with CSS only. Ofc backend validation is very important.

    For better accesibility i also recommend you to check aria labels. Forms are actually are more than they seem and great to learn accesibility.

    Marked as helpful
  • Samuel Richmond•190
    @Samuel-501
    Posted 8 months ago

    I also had some problems on grid display and also with the divs

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
Frontend Mentor logo

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

Frontend Mentor

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

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

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

How does the accessibility report work?

When a solution is submitted, we use axe-core to run an automated audit of your code.

This picks out common accessibility issues like not using semantic HTML and not having proper heading hierarchies, among others.

This automated audit is fairly surface level, so we encourage to you review the project and code in more detail with accessibility best practices in mind.

How does the CSS report work?

When a solution is submitted, we use stylelint to run an automated check on the CSS code.

We've added some of our own linting rules based on recommended best practices. These rules are prefixed with frontend-mentor/ which you'll see at the top of each issue in the report.

The report will audit all CSS, SCSS and Less files in your repository.

How does the HTML validation report work?

When a solution is submitted, we use html-validate to run an automated check on the HTML code.

The report picks out common HTML issues such as not using headings within section elements and incorrect nesting of elements, among others.

Note that the report can pick up “invalid” attributes, which some frameworks automatically add to the HTML. These attributes are crucial for how the frameworks function, although they’re technically not valid HTML. As such, some projects can show up with many HTML validation errors, which are benign and are a necessary part of the framework.

How does the JavaScript validation report work?

When a solution is submitted, we use eslint to run an automated check on the JavaScript code.

The report picks out common JavaScript issues such as not using semicolons and using var instead of let or const, among others.

The report will audit all JS and JSX files in your repository. We currently do not support Typescript or other frontend frameworks.

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub