Skip to content

Latest commit

 

History

History
60 lines (38 loc) · 1.02 KB

README.md

File metadata and controls

60 lines (38 loc) · 1.02 KB

#Validate

version: 0.1.12

Validate is a requireJS module to validate forms, using jquery has dependency.

Bower

bower install validate

Usage Example

First you need to define all required inputs using the class "required".

<form id="frm-validate">
    <label for="email">E-mail</label>
    <input type="text" name="email" class="inputs required" />
</form>

JavaScript Integration

Now, you need to create a validate instance.

Javascript

define(['jquery', 'validate'], function ($, validate) {
    var frm = $('#frm-validate');
    var formvalidate = new validate.Validate(frm);

    //Check if form is valid
    if (formvalidate.isValid()) {
        //Code Here...
    }
});

How to contribute

Install node dependencies, check package.json and bower.json

npm install && bower install

Use command grunt release to deploy your changes after your commit.

Contribuitors

License

Licensed under the MIT License