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

A responsive signup page with basic email validation

Aayush Jha 380

@Aayush895

Desktop design screenshot for the Newsletter sign-up form with success message coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
2junior
View challenge

Design comparison


SolutionDesign

Solution retrospective


I was able to make the site as close to the mockup as possible but I think that I could have written the javascript code in a much cleaner and optimised way. If anyone can provide some tips or suggestions on how I can optimise the javascript part of this code then I will be really grateful.

Community feedback

@yaadevmohit

Posted

Here are some suggestions after looking at your code:

  1. You need to improve your desktop design for bigger screen sizes as it start stretching too much. Consider adding max-width and max-height to your component-container.
  2. Still need to implement mobile design in case you are not aware.
  3. In javascript, consider using regex for email validation.
  4. For validation you want the errorMsg to stay until the user types a valid email. Try implementing the removal of error message after the submit button if its a valid email.
  5. Modular javascript is a good way to creating reusable code using vanilla javascript. Here's a youtube playlist for that https://www.youtube.com/watch?v=HkFlM73G-hk&list=PLoYCgNOIyGABs-wDaaxChu82q_xQgUb4f&ab_channel=LearnCode.academy

I'll take a look at your code again later in detail and add more suggestions here.

Marked as helpful

2

Aayush Jha 380

@Aayush895

Posted

@yaadevmohit thank you for your suggestions and I was wondering if you could clarify point number 2. I am asking you about this because I implemented the responsive design for the sign-in page. But based on your comment and after rechecking the site I am assuming that you are talking about the success message component. If there is anything else besides that then I would be grateful if you could provide me with a bit more clarity as I ran the site on a responsive-design simulator to recheck the working of the website for various devices and other than the success page everything else seems to work fine.

0

@yaadevmohit

Posted

@Aayush895 Ignore that point for now. For mobile design, I set the media query with max-width of 600px so I did't realize you did implement mobile design. I would still suggest to set max-width to around 600px for mobile design as you've words overlapping inside h1 between screen width of 500px and 600px.

0
Aayush Jha 380

@Aayush895

Posted

@yaadevmohit Oh alright thank you for the clarification I will surely work on that.

0

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