kcValidate

Another form validation plugin for jQuery

Tweet

About

Current Version: .04b (12/10/2013)
ShowHide Changelog
.04b .04a .03a .02b .02a .01a

kcValidate is designed to be the ultimate drop-in validation plugin for both new projects and existing ones. It is built on class-based identification methods and can be implemented into an existing project with hardly any changes to the code.

kcValidate came to existence while looking for a validation plugin to use on another project. Of all the possible solutions I found, none were perfect. Some were overly complicated, some too simple, and some just didn't work at all. So I built kcValidate.

kcValidate doesn't require you to add any additional elements to your page or modify your form in any way. It works by assigning data attributes to your existing input fields. In order to avoid collisions, all classes are prefixed with kcv.

In addition to performing validation on several types of data, kcValidate also perform auto-formatting on fields such as phone number and tax ID. For more information on this, please read over the usage section below.

kcValidate is currently under development and new validation methods are being added regularly. If you have a suggestion I would love to hear it. Drop me a line at root@kevinacrider.com and please check back regularly for updates!

Examples

kcValidate Examples

Usage

After including the .js file, you initialize kcValidate like so:
        $(document).ready(function() {
          $('form').kcValidate();
        });
      
In the example above we are going to validate every form on the page. You may replace 'form' with an ID or class to target different elements.

When a form is validated, any input that does not pass validation will be assigned the class 'kcv-failed' unless a class is passed in the settings object. This class is also applied to the parenting label of the input that failed to allow for additional styling.

If a form passes all the validation that's been assigned to it, it will process as it normally would.

Validation Methods

Options

In order to increase compatibility and maintain the universal usage of the plugin, additional options are constantly being added. If you have a suggestion, I would love to hear it! Just drop me a line at root@kevinacrider.com.

Download

kcValidate on GitHub