Simple JavaScript validation
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
tests
.gitignore
README.md

README.md

A simple Javascript Validation runner

var validate = new Validate(
	{
		name: {
			pattern: /^.{8,}$/
		},
		occupation: {
			pattern: /^.{20,}$/,
			required: true
		}
	},
	{
		name: 'Mal Reynolds',
		occupation: 'Captain Tight Pants'
	}
);

if(!validate.isValid){
	console.log(validate.failed.join(', '));
}