<!--
MooTools is released under the Open Source MIT license,
which gives you the possibility to use it and modify
it in every circumstance.
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
#form_box { float: left;
width: 290px;
background: #f8f8f8;
border: 1px solid #d6d6d6;
border-left-color: #e4e4e4;
border-top-color: #e4e4e4;
font-size: 11px;
font-weight: bold;
padding: 0.5em;
margin-top: 10px;
margin-bottom: 2px;
}
#log_res.ajax-loading {
padding: 20px 0;
background: url(http://demos111.mootools.net/demos/Group/spinner.gif) no-repeat center;
}
</style>
<script type="text/javascript" src="../mootools.js"></script>
<script type="text/javascript">
window.addEvent('domready', function() {
// You can skip the following two lines of code. We need them to make sure demos
// are runnable on MooTools demos web page. if (!window.demo_path) window.demo_path = '';
var demo_path = window.demo_path;
// --
$('myForm').addEvent('submit', function(e) {
//Prevents the default submit event from loading a new page.
e.stop();
//Empty the log and show the spinning indicator.
var log = $('log_res').empty().addClass('ajax-loading');
//Set the options of the form's Request handler.
//("this" refers to the $('myForm') element). this.set('send', {onComplete: function(response) {
log.removeClass('ajax-loading');
log.set('html', response);
}});
//Send the form. this.send();
});
});
</script>
<title>MooTools: Form.Send Demo</title>
</head>
<body>