Mootools Moo.Form Example

Overview

This page gives an overview of Ajax.Form object. It is an extension of the Mootools Ajax object, and provides a way to submit an html form via ajax.

But wait! There's more!

It also submits forms with input type=file! Sweet!

Submitting a regular form provides you all the callbacks and options of a Mootools Ajax object.

Submitting a form with inputs of type file on it will provide you with several options (which need to be documented) and the ability for an onComplete callback. Unfortunately, there is no way to access the http status codes of an iframe, so there is no way to know if the upload failed. But, hey... it works - try it out!

The documentation is a bit lacking right now as I have to continue with other work, but I'll try and flush it out later.

Upload Form Example

Upload a an image file (.jpg, .gif, or .png) less than 500px and watch it magically appear! (the form is submitted via an onchange event)

Simple Form Example

Fill in the box and hit submit. My server will tell you what you said.

This is your value:
Documentation

Class Moo.Form

Description

Arguments

element the form element to create the Moo.Form from
options Options for the Moo.Form

Options

See the docs for Ajax as those options are also available to this object

appendData additional data to append to the form on submit
bind boolean value to bind the event to the submit event of the form, and cancel the default action (defaults to true)

Example

new Moo.Form('element', options);
Download

Moo.Form.js

Discuss

Joomlicious!