1.0.3 • Published 5 years ago

rr-validation v1.0.3

Weekly downloads
1
License
ISC
Repository
-
Last release
5 years ago

Reading Room Validation

A small, lightweight module to provide some validation to your forms.

Installation

$ npm install rr-validation

Basic Usage

import { EmailValidation, RequiredValidation, TelephoneValidation } from 'rr-validation';

new EmailValidation('.email-field');
new RequiredValidation('.required-field');
new TelephoneValidation('.telephone-field');

Ensure your form's labels follow correct HTML semantics and have the for attribute which matches the id of the input it corresponds to. This is needed to display validation error messages in real time as the form is filled in.

Disable Submit

<button type="submit" class="submit-button">Submit</button>

Create a submit button which has the class .submit-button. The module will then disable the button if any of the validation rules have been broken within the form.

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago