Design comparison
Solution retrospective
hey everyone hope you're all doing well, I had lots of fun and a headache making this also used someone's suggestion and was able to change the color of the svgs s yay. I have a question regarding form validation is it possible to get the email error message without js, all the videos I saw used js if you have any suggestions please comment thank you, and have a great day.
Community feedback
- @DavidMorgadePosted about 2 years ago
**Hello Oduh, congrats on finishing the challenge ! **
Regarding your question, yes, you can use the default validation from your html (you can see in your own project if you enter a wrong email it has some validation from default), if you want to make it more restrictive, you can use a
pattern
in your html<input>
, also if you want this pattern to work you need to set another property on your<input>
wich is called required. This patterns can be filled with a regular expression, see this example I took from stackoverflow:<input type="text" pattern="/^[a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/" required >
With this you will have a validation without the need of Javascript, I would recommend using JS because you can manipulate better the error messages, but with the html one you are fine!
Hope my answer helped you!, if you have any questions, don't hesitate to ask
0@preciousoduhPosted about 2 years ago@DavidMorgade oh I see thank you so much David!! Yes it did I hope you have a very pleasant dayyy
1
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