0.6.1 • Published 4 years ago

validaty v0.6.1

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

Validaty - A Validation Plugin

Build Status NPM Version Dependency Dev Dependency Maintainability Patreon

Required Files

  • jquery.validaty.css
  • jquery.validaty.js
  • jquery.validaty.validators.js

Options

PropertyvalueDescription
errorTargetundefinedCallback to intercept the errors
focus'first'Field to be focused when validation fails
ignore':submit'Fields to be ignored
onInvalidundefinedCallback called when some field is invalid
onMessageundefinedCallback called when validation message is shown
onValidundefinedCallback called when all fields is valid
validators{}Object to hold the validators functions

Usage

data-validaty

The attribute data-validaty receives the validation name.

<form>
  <input type="text" data-validaty="required">
</form>
$('form').validaty();

data-validaty-ignore

Used to ignore some validation included on data-validaty.

<form>
  <input type="text" data-validaty="required" data-validaty-ignore="required">
</form>

on

Add the key on: with the action you want to trigger the validation.

<form>
  <input type="text" data-validaty="required on:blur">
</form>

Functions

$('form').validaty('helper');              // Gives you the internal helpers.
$('form').validaty('validator');           // Gives you a validator.
$('form').validaty('destroy');             // Destroy the Validaty's bind.
$('form').validaty('validate', selectors); // Execute the validation over the form or the given selectors.

Validators.js

This file should contain all validators, just includes your validations calling register.

PropertyDescription
validation-nameThe name of your validation
validation-messageThe message shown when you validation fails return false
formThe validated form
word???
0.6.1

4 years ago

0.6.0

4 years ago

0.5.2

7 years ago

0.5.1

7 years ago

0.5.0

7 years ago

0.4.1

7 years ago

0.4.0

7 years ago