Design comparison
Solution retrospective
To get rid of the browser validation messages, I left out the required
from the input
tag and changed type: "email"
to type: "text"
. This way, only my validation messages appear when not typing anything or when typing an invalid email address. Is this the correct approach or is there a way to hide the browser messages while keeping the required
and the type: "email"
?
Community feedback
- @vanzasetiaPosted about 2 years ago
Hi, Daniel! π
Congratulations on finishing this challenge! π
To remove the browser's validation, I recommend adding
novalidate
attribute to theform
element with JavaScript. Then, still use the correct type of input andrequired
attribute as a fallback.So, if the JavaScript is failed to load or the users disable the JavaScript, the form still has the native validation. Then, if the JavaScript is available then it will use the custom validation.
I recommend reading the "How To Create Accessible Form with Boring Design?" article. It tells about how to create accessible form validation by using
aria-live
andaria-describedby
. It also tells you about my process of writing HTML, CSS, and JavaScript with some best practices.More suggestions:
- Logo is an important content of the page. So, it needs to have a label or alternative text. Since you are using inline SVG, I recommend doing the following to add alternative text. Or just use
img
tag.
<svg role="img"> <title>Base Apparel</title> </svg>
- Use CSS to uppercase the text. The uppercased word in the HTML might be spelled by the screen reader (spelled letter by letter).
- The hero image is not adding meaningful information. That means it is a decorative image. So, leave the alternative text empty (
alt=""
). This way, the screen reader users can skip the image. - I don't think the
input
needs to be wrapped byfieldset
. It's just oneinput
so there's no need to do that. - The way you label the
button
element is to usearia-label
notvalue
attribute. - For decorative SVGs, add
aria-hidden="true"
attribute to thesvg
. - Avoid using JavaScript to add styling (unless you have no other option). JavaScript allows you to change the CSS code using the
style
property. But, to make debugging easier and improve code maintainability, itβs best to avoid it. Use CSS classes instead.
That's it! I hope this helps!
Marked as helpful3@Daniel77aprPosted about 2 years agoHi, @vanzasetia!
Thank you for your guidance, this helps a lot! I will definetly check the article and improve my code.
0 - Logo is an important content of the page. So, it needs to have a label or alternative text. Since you are using inline SVG, I recommend doing the following to add alternative text. Or just use
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