saurabhbakolia / SCROLLME--ECOMMERCE-WEBSITE

ScrollMe is an open-source eCommerce platform built with JavaScript, React, Styled Components, Node.js (Express), and MongoDB. It offers a modern shopping experience with a scalable backend, perfect for contributors or those learning modern web development.
https://www.scrollme.online/
MIT License
19 stars 65 forks source link

add functionality to newsletter form #137

Open ananyag309 opened 1 month ago

ananyag309 commented 1 month ago

Implement email validation in the newsletter form to ensure users enter a valid email address. Once a valid email is submitted, display a confirmation message to confirm successful subscription.

saurabhbakolia commented 1 month ago

Can you please tell me?

how are you going to implement this feature?

ananyag309 commented 1 month ago

@saurabhbakolia To implement email validation in your newsletter form, first set up a form with an email input field and a submit button. Use the email input type in HTML to take advantage of the browser's built-in validation for email format. In the JavaScript, add an event listener to handle the form submission. Before allowing the form to submit, check whether the email entered is valid. If the email is correctly formatted, display a confirmation message informing the user that their subscription was successful. If the email is invalid, prevent the form submission and prompt the user to enter a valid email. and for confirmation message i will use a popup modal