Code Monkey home page Code Monkey logo

react-easy-test---react-easy-signup-form---wih74yv236gv's Introduction

React form validation

We will be creating a form with 4 fields.

  1. Input with id="name" for taking the name of the user.
  2. Input with id="email" for taking the email of the user.
  3. Input with id="password" for taking the password of the user.
  4. Checkbox input with id="consent" which is unchecked by default.
  5. And a button for submitting the form with "Signup" as text inside.

Note:- All inputs should have their corresponding labels.

For validation , there is a helper function in utils/validation.js which takes an object,with keys "email","password" and "name" and returns the relevant errors for those fields in an object. Display validation errors using this function(this only returns an error, you have to display the errors returned by the function). It returns null if there is no error.

Every time user clicks on submit button, display only the relevant users, so if initially user did not fill anything and all fields were showing error, but later filled "name" field with valid value, so the error below "name" field should be removed, and all other fields still showing error.

Display the errors below the field they belong to, ex:- if error is in name validation, it shows the error below name input.

react-easy-test---react-easy-signup-form---wih74yv236gv's People

Contributors

curiousraccoon08 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.