Request.HTML MooTools 1.2

Data from Element - submit form:

<form action='' method=post id=user-form>
<input type=text name=search />
<input type=submit class=submit value=Submit />
</form>
<div id=log></div>
$(form1).addEvent(submit, function(e) {
new Event(e).stop();
new Request.HTML({
url: form.php,
update: log,
onRequest: function() {$(user-form).empty().addClass(ajax-loading);},
onSuccess: function() {$(user-form).removeClass(ajax-loading); alert(onSuccess);}
}).post($(user-form));
});

Data from Element - variable:

$(button).addEvent(click, function(e) {
new Event(e).stop();
new Request.HTML({
url:form.php,
method: get,
data: { var : text},
update: $(box),
onRequest: function() {$(box).empty().addClass(ajax-loading);},
onSuccess: function() {$(box).removeClass(ajax-loading); alert(onSuccess);}
}).send();
});