Skip to content

Conversation

@Grandi0z
Copy link
Owner

In this Milestone we :

Add an email validation in the contact form

Copy link

@anagudelogu anagudelogu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

STATUS: CHANGES REQUIRED ♻️ 🚧

Hi @Grandi0z,
I'm Andres.

While you have done a great job working on this milestone 💻 , there are some issues that you still need to work on to go to the next project. ♻️

You are almost there, keep up the good work! 🚀

Highlights

✅ Great use of GitHub flow. 💯
✅ Your project is documented professionally. 📜
✅ Great UI design. 💻
✅ Descriptive PR title, summary and commit messages. 💬

Required Changes ♻️

Check the comments under the review.

Optional suggestions

Every comment with the [OPTIONAL] prefix is not crucial enough to stop the approval of this PR. However, I strongly recommend you take them into account as they can make your code better.

Cheers and Happy coding!👏👏👏

Feel free to leave any questions or comments in the PR thread if something is not 100% clear.
Please, remember to tag me in your question so I can receive the notification.

Please, do not open a new Pull Request for re-reviews. You should use the same Pull Request submitted for the first review, either valid or invalid unless it is requested otherwise.


As described in the Code reviews limits policy you have a limited number of reviews per project (check the exact number in your Dashboard). If you think that the code review was not fair, you can request a second opinion using this form.

Comment on lines 175 to 187
function emailValidation() {
const userEmail = email.value.trim();
if (!isEmailValid(userEmail)) {
errorScreen.textContent = 'Please Email must be all in lowercase';
email.classList.add('error');
email.classList.remove('success');
}
}

form.addEventListener('submit', (event) => {
event.preventDefault();
emailValidation();
});

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • You did a great job working on this milestone! 🚀 However, there's a problem trying to submit a valid email. This happens because you're preventing the form's default behavior and running the emailValidation function which only handles the error case. I suggest you add an else clause that runs if the email IS valid and submits the form, granting the expected behavior of this feature! 🤓 🛠️

Something like this:

Suggested change
function emailValidation() {
const userEmail = email.value.trim();
if (!isEmailValid(userEmail)) {
errorScreen.textContent = 'Please Email must be all in lowercase';
email.classList.add('error');
email.classList.remove('success');
}
}
form.addEventListener('submit', (event) => {
event.preventDefault();
emailValidation();
});
function emailValidation() {
const userEmail = email.value.trim();
if (!isEmailValid(userEmail)) {
errorScreen.textContent = 'Please Email must be all in lowercase';
email.classList.add('error');
email.classList.remove('success');
} else { // This runs if the email is valid
errorScreen.textContent = '';
email.classList.add('success');
email.classList.remove('error');
form.submit()
}
}
form.addEventListener('submit', (event) => {
event.preventDefault();
emailValidation();
});
Please consider applying this! 🤓

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@anagudelogu, Thank you very much... You're the best 😃

Copy link

@t-yanick t-yanick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Grandi0z,

Great job !!!

To Highlight! 👏 🟢

✔️ Good commit messages
✔️ Descriptive Readme file

Your project is complete! There is nothing else to say other than... it's time to merge it :shipit:
Congratulations! 🎉

Optional suggestions

Every comment with the [OPTIONAL] prefix is not crucial enough to stop the approval of this PR. However, I strongly recommend you to take them into account as they can make your code better.

N/A

Cheers and Happy coding!👏👏👏

Feel free to leave any questions or comments in the PR thread if something is not 100% clear.
Please, remember to tag me in your question so I can receive the notification.

Please, do not open a new Pull Request for re-reviews. You should use the same Pull Request submitted for the first review, either valid or invalid unless it is requested otherwise.


As described in the Code reviews limits policy you have a limited number of reviews per project (check the exact number in your Dashboard). If you think that the code review was not fair, you can request a second opinion using this form.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants