-
Couldn't load subscription status.
- Fork 0
Form validation #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Form validation #12
Conversation
There was a problem hiding this 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.
| 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(); | ||
| }); |
There was a problem hiding this comment.
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
emailValidationfunction which only handles the error case. I suggest you add anelseclause that runs if the email IS valid and submits the form, granting the expected behavior of this feature! 🤓 🛠️
Something like this:
| 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! 🤓 |
There was a problem hiding this comment.
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 😃
There was a problem hiding this 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 ![]()
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.

In this Milestone we :