Responsive newsletter signup page using client-side query parameter
Design comparison
Solution retrospective
I am proud that I was able to complete this project and learnt something new. Next time I would like to make my code more efficient by learning from the mistakes I made in this one.
What challenges did you encounter, and how did you overcome them?Sending the data from one page to another and collecting it there was a challenge for me. Moreover, using regex in js was difficult for me. I tried my best to understand these new concepts and came out with the solution.
What specific areas of your project would you like help with?I would like help with my javascript. I lack in a lot of things. Any help would be greatly appreciated.
Community feedback
- @Alex-Archer-IPosted 6 months ago
Hi! You've taken a pretty interesting approach here =)
And while it is totally fine for practice, if it was real project it'll be a bad user experience - to reload the page just to show up a modal window.
The better way would be to keep both windows in one html file and change
display
fromblock
tonone
via JS.Also there could be a couple semantic improvements:
- Use more semantic tags. Title must be in
h1
, text -p
, list of features -ul
, and every page should containmain
tag. - More important that the
input
should be inside theform
.
<form> <label for="email">Email address</label> <input type="email" id="email" name="email" placeholder="[email protected]"required> <button>Subscribe to monthly newsletter</button> </form>
This will be really important in real projects cos form is necessary to send data to the server. By the same reason
input
should have aname
attribute.Oh, and I can give a tip how to improve your regular expression =) Try this.
/[-.\w]+@([\w-]+\.)+[-\w]/g
It means:[-.\w]+ - any combination of letters, dot or hyphen @([\w-]+\.)+ - @ symbol followed by any combination of letters, dot or hyphen, followed by dot [-\w] - and than again any combination after the dot
That generate email pattern for validation and could make your code shorter =)
By the way, that's cool that you are use regexps, it's quite powerful tool =)
Hope something of all this could help =)
Marked as helpful1@Navroz-SinghPosted 5 months ago@Alex-Archer-I Thank you so much for giving your precious time to help me. I will take these recommendations into consideration for my next projects. I am new to webdev so I guess I gotta learn more.
1@Alex-Archer-IPosted 5 months ago@Navroz-Singh
Oh, there is always something to learn. Even if you think that you have learned enough and gained experience, just wait until new framework, library or specification pops up.
I'm not trying to discourage you! Learn is fun =)
1 - Use more semantic tags. Title must be in
Please log in to post a comment
Log in with GitHubJoin 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