On Dec 10, 6:04 pm, Jean Ceugniet <jean.ceugn...@gmail.comwrote:
Quote:
Hi,
>
I just made my very first ajax form submitting. This works perfectly
(myAjax01 is a variable external to this function).
>
****************************
Code >>
****************************
$("formRecherche").addEvent("submit", function(e) {
/**
* Prevent the submit event
*/
new Event(e).stop();
I love how these Prototype-like libraries force you to create a new
object to accomplish the simplest tasks.
Quote:
>
/**
* This empties the log and shows the spinning indicator
*/
$("formRecherche").className = "ajax_loading_01";
/**
* send takes care of encoding and returns the Ajax instance.
* onComplete removes the spinner from the log.
*/
myAjax01 = this.send({
onComplete: function() {
formRechercheMaj (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 >>
****************************
$$("#formRecherche input").each (function (champ)
{
if (champ.type == "checkbox")
{
champ.addEvent ("click", function ()
{
$("formRecherche").fireEvent ("submit");
Unless I miss my guess about MooTools fireEvent method, that won't
submit the form. What you need to do is name your submit listener
function. Then you can call it from here.
Quote:
});
}
>
});
>
****************************
<< Code
****************************
>
Could someone used tu mootools and ajax help me, please ?
I know virtually nothing about MooTools (sp?) other than the code was
inspired by Prototype and augments host objects. In other words, it
should be avoided.