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

Subscription form with validation and success page

Filippo 375

@Filippo-B

Desktop design screenshot for the Intro component with sign-up form coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


Hi! I have a couple of questions:

  • I made two pages, one for the form, the other is a success page. The validation of the form is triggered when the user clicks on the form button. The problem is that the event listener for the button throws an error when i am on the success.html page because it can't find any button ("Cannot read property 'addEventListener' of null" or something). To solve this I put the event listener in an if statement, so that it triggers the event listener only if the element exists. Is this best practice? Are there better ways to do this?

  • Regarding accessibility and aria roles, do you know any resource that explains the basics of using the aria roles in forms?

Thank You.

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