Form coded with using of useReducer.
The Reducer is used to manage the position of the labels while content is inside the boxes.
You can also switch visibility of the Password field and Confirm Password field, with a click on the icon managed by useState.
The form is validating throught these criteria:
- Name: if there is a name included in DUMMY_NAMES array, it will return as "already in use";
const DUMMY_NAMES = [ "Neo", "Trinity", "Morpheus", "Cypher", "Tank", "Apoc", "Mouse", "Switch", "Dozer" ];
-
Email: if the string doesn't contain the "@", the form will give an error message;
-
Password: it as to be at least 8 digits;
-
Confirm password: as obvious, it must be equal to the password field.
Thanks for Advent of CSS and JAVASCRIPT for the graphic template.