Wednesday, June 3, 2009

[jQuery] html() method block for

the function below work fine for only one checkbox checked

when i select more than one checkbox
the for stop after the first tour
it seems that the html method block the form

infact, if i comment out the method html(...) all the function work
fine.

can someone show me the way ?

THIS IS THE FUNCTION:

function switchState (form) {
for (var i = 0 ; i < form.length ; i++){
if(form[i].checked){
var prenotazioneid = form[i].value;
var selettore = "tr#prenotazione_" + prenotazioneid;

$(selettore).html( '<img height="19" width="220" alt="AjaxLoader"
src="/images/ajax-loader.gif"/>' );

$(selettore).load("prenotazione/updatestato",{stato_id:
1,prenotazione_id: 1});

}//endif
}//endfor
}//endfunction

No comments: