Design comparison
Solution retrospective
Newsletter Sign-up Form with Success Message
This is a simple newsletter sign-up form with a success message solution created using JavaScript, HTML, and CSS. It allows users to input their email address, submit the form, and see a success message if the submission is successful. Additionally, it provides form validation to handle empty fields and incorrectly formatted email addresses.
Table of Contents
Overview
The Challenge
The challenge was to build a newsletter sign-up form with the following requirements:
- Users should be able to add their email and submit the form.
- A success message with their email should be displayed after a successful submission.
- Form validation messages should be shown if:
- The field is left empty.
- The email address is not formatted correctly.
- The layout should adapt to different screen sizes.
- Hover and focus states for interactive elements should be styled.
Demo
You can view a live demo of this solution here.
Installation
To run this project locally, follow these steps:
-
Clone the repository:
git clone https://github.com/yourusername/newsletter-signup-form.git
Usage
Open the web page in your browser.
Enter your email address in the input field.
Click the "Submit" button.
If the email is valid and not empty, you will see a success message with your email. Otherwise, validation messages will be displayed.
Contributing
Contributions are welcome! If you have any suggestions, improvements, or bug fixes, please open an issue or create a pull request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Community feedback
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