Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Object validation in Javascript.
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
examples
lib
spec
Guardfile
README.markdown

README.markdown

Formal: FOOP object validation

Formal is an object validator. It is aimed at form validation but it will be able to validate regular JS objects.

Install

Browser

Include the following script inside your layout:

<script src="/path/to/formal.js"/>

Don't forget to change the path accordingly.

Usage

To start validating your object, simply call:

Formal.is_included_into(object);

Run the validation:

object.validate();

That's it! It will return a boolean.

Roadmap

  • Actually declare validations with object.validates("rule", "attribute").
  • List of errors inside the object (object.errors).
Something went wrong with that request. Please try again.