Deviopath › React

Signup Form Validation

Medium · Forms

Validate a signup form when it is submitted.

Rules:

- the email must contain "@", otherwise show <p className="error">Invalid email</p>

- the password must have at least 6 characters, otherwise show <p className="error">Password too short</p>

Show every error that applies, in that order. If there are no errors, show <p className="success">Welcome!</p> instead. Nothing is shown before the first submit.

Next: RGB Color Mixer