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

Intro Component with signup form

Lucas 👾 104,580

@correlucas

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

Community feedback

Daniel 🛸 35,900

@danielmrz-dev

Posted

Fala, Lucas!

Tenho uma sugestão sobre o Javascript:

📌 A validação que você usou na função adiciona o ícone de erro caso os inputs estejam vazios, porém você não adicionou uma instrução que remova esse ícone caso o input não esteja mais vazio.

Então se você tentar enviar com algum dos inputs vazio, ele mostra o ícone, mas se você voltar e preencher o input, o ícone de erro não desaparece.

📌 Uma outra sugestão seria você fazer aparecer as mensagens de erro junto com o ícone de erro. No seu HTML, o elemento até existe, você colocou display: none nele, então ele não aparece. Você poderia mudar o display pra block usando o javascript dentro da mesma validação que verifica se o input está vazio. Ficaria algo do tipo:

if (input está vazio) {
    mostre o ícone;
    mostre a mensagem de erro;
else {
    remova o ícone;
    remova a mensagem de erro;
}

Assim, tanto o ícone quanto a mensagem aparecem juntos.

Espero que ajude! Abraço!

Marked as helpful

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