Not Rated!1 Star2 Stars3 Stars4 Stars5 Stars

Vanadium – Simple Intuitive yet powerful client side validation

Vanadium is declarative client-side validation toolkit. These declaration can be done in two different ways:

* Using json structure
This method requires that elements under validation have to have their IDs defined. Granted that, one can declare validation of the form from [example] by including following code:

  var VanadiumRules = {
        email: ['required', 'email'],
        accept: ['accept'],
        desc: ['required']
        }
  

Using inline markup
This method simply uses special markup in html elements’ class attributes. The markup is very straightforward. It is consists up to three tokens, prepended with special prefix distinguishing the markup from regular CSS names and separate by special separator. The prefix and the separator are customizable and can be any string. The default prefix is : (colon) and the separator is ; (semicolon). The first token, which is mandatory, is validator type name. The second one is the parameter for the validator. E.g. number of characters when length validator is used. The third token is the ID of the html element serving as an advice into which the message informing about validation failure is inserted. Said that, a html for an element being required valid email address with advice of ID adv would look like:

Installation

The installation is dead simple. Just include vanadium.js in header of your HTML after the dependency (jQuery)

    <head>
            ...
            ...
            <script src="/js/vanadium.js" type="text/javascript"></script>
            ...
            ...
        </head>
          



Demo: http://vanadiumjs.com/#examples
Download: http://github.com/lambder/Vanadium/raw/master/dist/vanadium-min.js
Source: http://vanadiumjs.com/

72e3e tafbutton blue16 Vanadium – Simple Intuitive yet powerful client side validation

Related Listings:

  1. Simple and Clean Form Validation Script The complete example code (form and script) for Form Validation…
  2. Valid8 – An input field validation plugin for Jquery Valid8 solves both simple and complex validation scenarios. Everything from…
  3. jQuery inline form validation Engine When it comes to form validation, it’s hard to have…

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>