Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Sass and Javascript

murilo 110

@mlzzi

Desktop design screenshot for the Intro component with sign-up form coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


Hi guys,

This project gave me real work to function.

Please give me feedback.

In the email field, the type in input tag I changed it to text, because I wasn't having the result I want, like the correct email format, and the red message example in the placeholder. So I change it from email to text, added a Javascript function to correct format and it worked. But I shouldn't do this right?

How can I achieve a better result without changing the type input?

Community feedback

P
Matthias 630

@astragenius

Posted

Hey ho :) Good solution so far. Your layout is really accurate.

For your question for the Email input:

  • Set a "required" attribute and the "pattern" attribute and set an RegEx for Email validation in it. For example
<input type="email" id="email"  placeholder="Email Address" pattern="/[\w\-\._]+@[\w\-\._]+\.\w{2,10}/" required>

You should set the 'label' html element to each input element.

Link for further Reading

for example

<label for="email"></label>
<input type="email" id="email">

or

<label for="email">
<input type="email" id="email">
</label>

Technical you don't need Javascript for clientsite formvalidation. You can it do only with CSS pseudo-classes.

For example

input:invalid {
  border: 2px dashed red;
}

input:invalid:required {
  background-color: red;
}

input:valid {
  border: 2px solid green;
}

MDN Webdocs CSS Tricks

0

@maqsudtolipov

Posted

Hi there 👋

Congratulate on finishing your project 🎉. The design looks beautiful 😃.

The email has the type of email because it helps the people who uses screen readers 👍. And also when you work with the backend it helps to get the email address easily. You can check if the email is all lowercase if not then show warn to put lowercase email 🍀

Happy coding ☕

0

Please log in to post a comment

Log in with GitHub
Discord logo

Join 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