Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted about 1 year ago

Newsletter signup form with JS validation

P
Jan Kotvaš•460
@DrakeHermit
A solution to the Newsletter sign-up form with success message 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?

This is the second time I finished this challenge and I wrote my JS way different this time, and added a new feature to it(automatic error state remover). So I suppose that I could redo this challenge every so often as my JS skills improve and all the time the solution would be different to a degree.

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

I faced different kind of challenges all that I would overcome by researching topics or watching videos. The biggest problem I faced and didn't manage to overcome was the fact that I wanted to store the current state of the html in a variable which sort of worked but it didn't store the CSS itself for some reason. But this is something I will do my best to learn for the next challenges that are coming up.

What specific areas of your project would you like help with?

Just general code review for my JS code and how I styled the page with CSS. I still have a ton to learn from my mistakes.

Code
Couldn’t fetch repository

Please log in to post a comment

Log in with GitHub

Community feedback

  • ijohnst•230
    @ijohnst
    Posted about 1 year ago

    First of all great work!

    One thing that might help is to use the <picture> element to swap from the desktop to mobile image on mobile screen sizes (right now in mobile view you have the desktop.svg showing). This worked for me: <picture class="signup--image"><source srcset="./assets/images/illustration-sign-up-desktop.svg" media="(min-width: 55em)"><img src="./assets/images/illustration-sign-up-mobile.svg" alt="Illustration of a website dashboard and tablet"></picture>

    Just make sure the media attribute in there matches whatever breakpoint you are using for your media queries

    Marked as helpful

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