Quantcast
Channel: Niko » Downloads
Viewing all articles
Browse latest Browse all 3

quickValidation.js jQuery Plugin

$
0
0

Look out, it’s another jQuery plugin going your way. This latest Rails project has been forcing me to write a lot of Javascript and most of the time the plugins I find don’t cut it. So here is my rendition of a jQuery form validator. You can check out the plugin site, the code on GitHub, or just download the source right away. More after the break.

What makes this form validation different?

I wrote this plugin because I didn’t like how the jQuery validate plugin functioned. All form rules were put in the javascript and I thought that wasn’t very modular and I needed something more dynamic. This plugin places all the rules inside the input box itself. Defining rules is as simple as adding a data-attribute tag with your rules, separated by commas, inside.

What does it work with?

The plugin validates text fields and textareas. Radio buttons, in my opinion, do not need to be validated because you can set a default selected value if it is required. The plugin can check for required fields, numbers, integers, email addresses, phone numbers and custom regular expressions. You can also check against minimum and maximum character counts, as well as a ranges for number inputs. Pretty nifty.

Custom errors too!?

Yep, this plugin handles error notifications and allows you to set what you want your errors to read like. With a few variables like the name of the field (grabbed from a data-name attribute) and the values of the rules, error messages are all dynamic. A dream come true!

Download

Like always, the plugin is free and open to use, modify, edit, and delete however you please. A credit link, a tweet mentioning the plugin, or even just a follow on twitter is always appreciated. If you do use the plugin, I’d love to hear about how you are using it. Anyway, you can download the source off GitHub.


Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles





Latest Images