#90 : ENHANCEMENT: Show Newsletter Subscription Confirmation message solved #95
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
This pull request solves issue #90. It adds email validation to the newsletter subscription form, ensuring that the user enters a valid email address before showing the subscription confirmation modal. If the email address is invalid, an error message is displayed, and the subscription modal does not appear.
Changes Included:
Email Validation Logic:
A regular expression is used to validate the email format before submission.
If the email is invalid, the user is prompted with a clear error message asking them to input a valid email address.
Modal Visibility Control:
The subscription modal will only be shown if the user inputs a valid email.
This enhances the user experience by preventing invalid form submissions and unnecessary modal popups.
Form Handling:
Added onSubmit to the form to handle the submission properly, preventing default behavior until email validation is successful.
Error Message Display:
If the email is not valid, an error message is dynamically displayed under the input field.
Error message disappears once a new valid email is entered.
Screen Record :
Screen.Recording.2024-10-05.182333.mp4
Testing:
Tested the form with both valid and invalid email formats.
Ensured that the modal appears only when the email is valid.
Verified that error messages are displayed correctly for invalid input.