All Projects → CharlGottschalk → Approvejs

CharlGottschalk / Approvejs

Licence: mit
A simple JavaScript validation library that doesn't interfere

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Approvejs

FilterInputJs
Tiny and Powerful Library for limit an entry (text box,input) as number,string or more...
Stars: ✭ 37 (-88.99%)
Mutual labels:  validator, form-validation, javascript-library, validations
Formhelper
ASP.NET Core - Transform server-side validations to client-side without writing any javascript code. (Compatible with Fluent Validation)
Stars: ✭ 155 (-53.87%)
Mutual labels:  validation, validator, form-validation, form
validate
An extension to the popular library validate.js that adds some useful custom validations out of the box. Also, a hub for all custom validations, that we have created, so you can easily add them to your own project.
Stars: ✭ 31 (-90.77%)
Mutual labels:  form, form-validation, javascript-library, validations
Validator.js
String validation
Stars: ✭ 18,842 (+5507.74%)
Mutual labels:  validation, validator, validations
React Form With Constraints
Simple form validation for React
Stars: ✭ 117 (-65.18%)
Mutual labels:  validation, form-validation, form
Form Validation.js
The most customizable validation framework for JavaScript.
Stars: ✭ 127 (-62.2%)
Mutual labels:  validation, form-validation, form
Legit
input validation framework
Stars: ✭ 81 (-75.89%)
Mutual labels:  validation, form-validation, form
Resolvers
📋 Validation resolvers: Zod, Yup, Joi, Superstruct, and Vest.
Stars: ✭ 222 (-33.93%)
Mutual labels:  validation, form-validation, form
Neoform
✅ React form state management and validation
Stars: ✭ 162 (-51.79%)
Mutual labels:  validation, form-validation, form
svelte-form
JSON Schema form for Svelte v3
Stars: ✭ 47 (-86.01%)
Mutual labels:  validation, form, form-validation
node-input-validator
Validation library for node.js
Stars: ✭ 74 (-77.98%)
Mutual labels:  validation, validator, form
pyvaru
Rule based data validation library for python 3.
Stars: ✭ 17 (-94.94%)
Mutual labels:  validation, validator, form-validation
Bootstrap Validate
A simple Form Validation Library for Bootstrap 3 and Bootstrap 4 not depending on jQuery.
Stars: ✭ 112 (-66.67%)
Mutual labels:  validation, form-validation, form
Ngx Dynamic Form Builder
FormBuilder + class-transformer + class-validator = dynamic form group builder for Angular10+
Stars: ✭ 93 (-72.32%)
Mutual labels:  validation, validator, form
formalizer
React hooks based form validation made for humans.
Stars: ✭ 12 (-96.43%)
Mutual labels:  validation, form, form-validation
Redux Form
A Higher Order Component using react-redux to keep form state in a Redux store
Stars: ✭ 12,597 (+3649.11%)
Mutual labels:  validation, form-validation, form
Vee Validate
✅ Form Validation for Vue.js
Stars: ✭ 8,820 (+2525%)
Mutual labels:  validation, validator, validations
Just Validate
Lightweight (~4,5kb gzip) form validation in Javascript Vanilla, without dependencies, with customizable rules (including remote validation), customizable messages and customizable submit form with ajax helper.
Stars: ✭ 74 (-77.98%)
Mutual labels:  validation, form-validation, form
ATGValidator
iOS validation framework with form validation support
Stars: ✭ 51 (-84.82%)
Mutual labels:  validator, form, form-validation
datalize
Parameter, query, form data validation and filtering for NodeJS.
Stars: ✭ 55 (-83.63%)
Mutual labels:  validation, validator, form

ApproveJs

A simple validation library that doesn't interfere

release npm CDNJS Build Status downloads


ApproveJs doesn't automatically attach itself to input change events or form submit events. It also doesn't manipulate the DOM for you by automatically displaying errors. This allows you to automate validation how you want.

With a single method (approve.value()), you can decide how to handle validation.

If you like to be in control or have a little OCD like me, ApproveJs is for you.

ApproveJs is also easily extended with custom tests.


Installation

Standalone

Download Latest Release

Unzip master.zip into your desired folder and add a script tag to the library before the end of your closing <body> tag

<script src="path/to/approve.min.js"></script>
Bower

In your terminal run:

$ bower install approvejs

Add a script tag to the library before the end of your closing <body> tag

<script src="path/to/bower_components/approvejs/dist/approve.min.js"></script>
cdnjs

Add a script tag to the library CDN url before the end of your closing <body> tag

<script src="https://cdnjs.cloudflare.com/ajax/libs/approvejs/[version]/approve.min.js"></script>

Get the cdn urls from here

Many thanks to cdnjs who kindly hosts ApproveJS through a reliable CDN

Node

In your terminal run:

$ npm install approvejs

or if you're using Yarn

$ yarn add approvejs

Require approvejs.

var approve = require('approvejs');

Usage

ApproveJS exposes a single method value that takes two parameters.

The first parameter is the value to validate and the second is the set of rules to test against.

var rules = {
    required: true,
    email: true
};

var result = approve.value('[email protected]', rules);

The returned result contains two properties:

{
    approved: boolean,
    errors: []
}

Accessing Errors

You can access errors returned by the result in one of two ways:

Errors Property
var i = result.errors.length;
while(i--) {
    console.log(result.errors[i]);
}
.each Method

The result object exposes an each() method for easily getting to errors.

result.each(function(error) {
    console.log(error);
});

Read documentation here.

If you would like to contribute to the project, please read contributing.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].