A simple form validator made with JavaScript. The validator will check if a field is empty and will return an error message below the specific field.
Clone this repository:
$ git clone https://github.com/luc-ribeiro/form-validator-js.git
For validations, insert a data-rules
attribute in the input you want to validate.
<input type="text" name="email" data-rules="required|email" />
<input type="password" name="senha" data-rules="required|min=4" />
Specify if the field is required required
in the data-rules and what the restriction is.
Use email
to validate emails and min
to validate the minimum number of characters.
Access the project using the Live Server extension of Visual Studio Code.
MIT © 2021 Lucas Ribeiro