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 using HTML and CSS

@TaskinSultana

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


As I'm new to javavscript....I don't know how to make form validation using javascript....so I have used <form> tag required attribute make this sign-in form....Give me some suggestions about how to do form validation using javascript...Though I didn't face any problem , but if I had made made any mistake feel free to point it out....and I'd be grateful if you can give me some feedbacks to improve 🙏

Community feedback

@rehberbey

Posted

Looks great! 🎀

  1. With HTML, you can already validate the form on the client side. You can use attributes like pattern and accept. I suggest you look at input attributes.

  2. You can use the :invalid pseudo-class to change the style of the element when the wrong input is entered.

  3. After that, it will be to submit the form to the server.

  4. If you still want to authenticate with javascript on the client side, you can read this. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#client-side_validation

<form action="" method="post">
    <label for="name">Name:</label>
    <input type="text" name="name" id="name" required  pattern="[a-zA-Z]+" placeholder="John" />
    <input type="submit" />
</form>
input:invalid {
    border: 2px solid red;
}
0

@TaskinSultana

Posted

@rehberbey Thank You So Much :)

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