Skip to content
This repository has been archived by the owner on Oct 21, 2022. It is now read-only.

filamentgroup/validator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⚠️ This project is archived and the repository is no longer maintained.

Validator

Filament Group

A small validation library.

Getting Started

Download the development version.

In your web page:

<script src="jquery.js"></script>
<script src="dist/validator.js"></script>
<script src="dist/validator.init.js"></script>
<script src="dist/validator.config.js"></script>
<script>
jQuery(function($) {
	$( document ).bind( "enhance", function(){
		$( "body" ).addClass( "enhanced" );
	});

	$( document ).trigger( "enhance" );
});
</script>

Required Validation

Add the required attribute to your input. Works with <input type="text"> (et al), <input type="checkbox">, <input type="radio">, <select>, and <textarea>.

Format Validation

Add the data-validate attribute with a validator key. Valid keys include: birthday (MM DD), ccexpiration (YYYY MM), credit, email, length (min, max using characters, selected options in a select, checked checkboxes, radios, words in a text input), numeric, password, passwordconfirm, phone, and zip.

Custom Messages

Build

To get all of the validation library, just run grunt from your commandline. If you would like to specify which validator extensions you'd like in your build, just use the --validators argument. Example: grunt --validators="birthday zip email"

Demo

Check the demo

Tests

Run the tests