Skip to content

Octaform additional is a complement for Octaform (https://github.com/octaform/octaform), it will provide you a validation package that can be used in conjunction. The package contains validations like email, extension, minlength and more.

License

Notifications You must be signed in to change notification settings

octaform/octaform-additional

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Octaform
Additional validations

Octaform Additional is a package that provides you a pre-set of validation. To know more about the Octaform Validation Core please check out the official documentation in https://github.com/octaform/octaform

Getting Started

Install using yarn:

yarn add octaform-additional

Or via npm:

npm install octaform-additional --save

After installed import the octaform-additional together with the Octaform and start to use:

import Octaform from 'octaform';
import validation from 'octaform-additional';

// Add the validations object into array
Octaform.validator.add([
  validation.email,
  validation.extension
])

Available validations

Validations Description How to use
date Given a date validate the format ( / | - ) date: MM/DD/YYYY | M/D/YY
email Only valid emails email: true
equalTo Requires the field to have the same value as another equalTo: <HTML_Attribute or ID>
extension Only valid file extensions, e.g. png, jpg extension: ['png', 'jpg']
letter Only letters is accepted [A-Z] letter: true
maxlength Define maxlength from text maxlength: 12
maxsize (bytes) Define maximum upload size maxsize: 50000
minchecked Define minimum of checked checkboxes minchecked: 2
minlength Define minlength from text minlength: 3
number Only numbers is accepted [0-9] number: true
pattern Requires a value in regex format pattern: ^[0-9]+$
range Require a given value range range: [5, 8]
required Make that the field be required required: true
url Require a valid url url: true
valueEquals Require a value to be the same as the predefined valueEquals: 'Dog'
valueNotEquals Define one value that shouldn't be equal valueNotEquals: 'Dog'

Demo

Take a look at the validations in the demo page: https://octaform.github.io

Changelog

Check out releases

License

The MIT License (MIT)

Copyright (c) 2020 Christian Fortes

About

Octaform additional is a complement for Octaform (https://github.com/octaform/octaform), it will provide you a validation package that can be used in conjunction. The package contains validations like email, extension, minlength and more.

Resources

License

Stars

Watchers

Forks

Packages

No packages published