Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wbotelhos/validaty
✅ Validaty - A Validation Plugin
https://github.com/wbotelhos/validaty
javascript jquery validate validation validator
Last synced: about 1 month ago
JSON representation
✅ Validaty - A Validation Plugin
- Host: GitHub
- URL: https://github.com/wbotelhos/validaty
- Owner: wbotelhos
- License: mit
- Created: 2013-02-13T03:31:16.000Z (almost 12 years ago)
- Default Branch: main
- Last Pushed: 2023-08-21T00:26:56.000Z (about 1 year ago)
- Last Synced: 2024-10-02T00:47:03.432Z (about 2 months ago)
- Topics: javascript, jquery, validate, validation, validator
- Language: JavaScript
- Homepage: https://www.danca.com
- Size: 612 KB
- Stars: 4
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: changelog.md
- License: LICENSE
Awesome Lists containing this project
README
# Validaty - A Validation Plugin
[![Tests](https://github.com/wbotelhos/validaty/workflows/Tests/badge.svg)](https://github.com/wbotelhos/validaty/actions/workflows/tests.yml)
[![NPM Version](https://badge.fury.io/js/validaty.svg)](https://badge.fury.io/js/validaty)
[![Maintainability](https://api.codeclimate.com/v1/badges/e152fa0075358ae855f1/maintainability)](https://codeclimate.com/github/wbotelhos/validaty/maintainability)
[![Sponsor](https://img.shields.io/badge/sponsor-%3C3-green)](https://github.com/sponsors/wbotelhos)## Required Files
+ jquery.validaty.css
+ jquery.validaty.js
+ jquery.validaty.validators.js## Options
|Property |value |Description |
|-----------|---------|-------------------------------------------------|
|errorTarget|undefined|Callback to intercept the errors |
|focus |'first' |Field to be focused when validation fails |
|ignore |':submit'|Fields to be ignored |
|onInvalid |undefined|Callback called when some field is invalid |
|onMessage |undefined|Callback called when validation message is shown |
|onValid |undefined|Callback called when all fields is valid |
|validators |{} |Object to hold the validators functions |## Usage
### data-validaty
The attribute `data-validaty` receives the validation name.
```html
```
```js
$('form').validaty();
```### data-validaty-ignore
Used to ignore some validation included on `data-validaty`.
```html
```
### on
Add the key `on:` with the action you want to trigger the validation.
```html
```
## Functions
```js
$('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`.
|Property |Description |
|------------------|-----------------------------------------------------------------|
|validation-name |The name of your validation |
|validation-message|The message shown when you validation fails `return false` |
|form |The validated form |
|word |??? |