about:morf

Home / К началу | Dwonload | На Русском | Examples / Примеры

Morf is a relatively small (12K compressed and 16K uncompressed) JavaScript program, which is meant to make your forms more usable.

With Morf you can create user-friendly forms with validation features - even if you are totally dumb in JavaScript.

The name "Morf" is an anagram to "form"

The goal of creating Morf was to attach new features to valid XHTML forms using as few additional scripting as possible. The main features are as follows:

Morf is an independent appplication (it does not use any third-party libraries).

The following features are implemented in Morf:

Morf basic usage

It is very simple to include Morf into your webpage: just insert the following code inside the <HEAD> tag: <script type="text/javascript" src="/path/to/morf.js"><srcipt>. Morf will then start its work after the page loads, and all the forms on the page (with the exception of those specially marked) will be handled by Morf.

Morf declarative syntax:

By default, Morf uses "x:" namespace, but you may change this behavior by setting a value for Morf.NS property.

Morf attributes:

How does Morf communicate with the server?

Form data are passed to the server by means of usual HTTP requests - GET or POST, depending on the value of the form's method attribute.

From server Morf expect a text containing a JSON-serialized JavaScript object. That object should contain three fields:

Known / possible bugs:

At the moment, I am working on form serialization algorythm. Current version may have problems serializing <input type="checkbox">, <input type="radio">, <select multiple="true()">


Questions, wishes etc - are greatefully accepted at crocodile2u at yandex.ru