JQuery validation plugin: practical, simple and extensible
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
demo Messages defaults and display control message Jan 17, 2013
doc addMethod deprecated in favor of newValidationRule Feb 24, 2017
lib Updated with new jquery Jan 21, 2013
localization package updates Mar 31, 2017
src add $.validarium.version Jul 4, 2017
test removing triggerHandler calls: it was never documented Mar 23, 2017
.eslintrc.json bump eslint version ; add .eslint config file Jul 25, 2017
.gitignore Grunt and package, builds correctly now Jul 8, 2014
.jshintignore More code to run on Travis Jul 7, 2014
.travis.yml bump bower version Feb 22, 2017
Gruntfile.js update deps version ; add jsdoc grunt task ; bump bower Apr 5, 2017
README.md fix MINLENGTH test ; update README Feb 22, 2017
bower.json update deps version ; add jsdoc grunt task ; bump bower Apr 5, 2017
build.properties
build.xml empacotamento zip /comment #60779 May 2, 2017
package.json bump eslint version ; add .eslint config file Jul 25, 2017
validarium.jquery.json ups 2.0.0 May 2, 2017

README.md

Build Status

Validarium

A JQuery validation plugin: practical, simple and extensible. Validates your existing forms in HTML without headaches. Developed by Corollarium.

Licensed under the MIT license.

Some ideas and code borrowed from jquery-validate.

Getting Started

Include jQuery and Validarium. Then apply Validarium to the form.

<form>
	....
</form>
<script src="jquery.js"></script>
<script src="jquery.validarium.js"></script>
<script>
$(document).ready(function() {
	$("form").validarium();
});
</script>

You can download the package, clone the repository or use bower.

bower install

Full documentation

See https://github.com/Corollarium/validarium/wiki

Examples

Required fields

<form>
	<input type="text" data-rules-required="true" />
</form>

Required with another message

This works for all the other items, too

<form>
	<input type="text" data-rules-required="true" data-rules-required-message="My message here" />
</form>

Minlength, maxlength

<form>
	<input type="text" data-rules-minlength="5" data-rules-maxlength="10" />
</form>

(note that minlength accepts empty values, if you don't want those use the "required" rule)

Two fields must match

<form>
	<input type="password" id="pw1" data-rules-equalto="#pw2"/>
	<input type="password" id="pw2" data-rules-equalto="#pw1"/>
</form>

Field must obey a regexp

<form>
	<input type="text" data-rules-regexp="^([a-zA-Z]{5})$" />
</form>

Floating point numbers, with minimum and maximum

<form>
	<input type="text" data-rules-min="4" data-rules-max="10" data-rules-number="true" />
</form>

Positive integers, with minimum and maximum

<form>
	<input type="text" data-rules-min="4" data-rules-max="10" data-rules-digits="true" />
</form>

Strings with maximum and minimum length

<form>
	<input type="text" data-rules-minlength="4" data-rules-maxlength="10" />
</form>

Url, email, domain

<form>
	<input type="text" name="someurl" data-rules-url="true" />
	<input type="text" name="someemail" data-rules-email="true" />
	<input type="text" name="somedomain" data-rules-domain="true" />
</form>

CPF and CNPJ

<form>
	<input type="text" name="customer-cpf" data-rules-cpf="true" />
	<input type="text" name="customer-cnpj" data-rules-cnpj="true" />
</form>

License

Copyright (c) 2012 Corollarium Tecnologia http://www.corollarium.com Licensed under the MIT license.