Hi,
I just made my very first ajax form submitting. This works perfectly
(myAjax01 is a variable external to this function).
*************** *************
Code >>
*************** *************
$("formRecherch e").addEvent("s ubmit", function(e) {
/**
* Prevent the submit event
*/
new Event(e).stop() ;
/**
* This empties the log and shows the spinning indicator
*/
$("formRecherch e").classNam e = "ajax_loading_0 1";
/**
* send takes care of encoding and returns the Ajax instance.
* onComplete removes the spinner from the log.
*/
myAjax01 = this.send({
onComplete: function() {
formRechercheMa j (myAjax01);
}
});
});
*************** *************
<< Code
*************** *************
but i'd like to remove the submit button (visually), and to make the
checkboxes "active" : they should make the same ajax call as if the form
is submitted, each time a checkbox is checked or unchecked, and this
doesn't work (i'm probably not using the event propagation the right
way, but i don't get it).
*************** *************
Code >>
*************** *************
$$("#formRecher che input").each (function (champ)
{
if (champ.type == "checkbox")
{
champ.addEvent ("click", function ()
{
$("formRecherch e").fireEven t ("submit");
});
}
});
*************** *************
<< Code
*************** *************
Could someone used tu mootools and ajax help me, please ?
I just made my very first ajax form submitting. This works perfectly
(myAjax01 is a variable external to this function).
*************** *************
Code >>
*************** *************
$("formRecherch e").addEvent("s ubmit", function(e) {
/**
* Prevent the submit event
*/
new Event(e).stop() ;
/**
* This empties the log and shows the spinning indicator
*/
$("formRecherch e").classNam e = "ajax_loading_0 1";
/**
* send takes care of encoding and returns the Ajax instance.
* onComplete removes the spinner from the log.
*/
myAjax01 = this.send({
onComplete: function() {
formRechercheMa j (myAjax01);
}
});
});
*************** *************
<< Code
*************** *************
but i'd like to remove the submit button (visually), and to make the
checkboxes "active" : they should make the same ajax call as if the form
is submitted, each time a checkbox is checked or unchecked, and this
doesn't work (i'm probably not using the event propagation the right
way, but i don't get it).
*************** *************
Code >>
*************** *************
$$("#formRecher che input").each (function (champ)
{
if (champ.type == "checkbox")
{
champ.addEvent ("click", function ()
{
$("formRecherch e").fireEven t ("submit");
});
}
});
*************** *************
<< Code
*************** *************
Could someone used tu mootools and ajax help me, please ?
Comment