send multiple values ajax jquery in the same time -
i have next code:
if(jquery('.delete').length > 0) { jquery('.delete').click(function(){ var c = false; var cn = 0; var o = new array(); jquery(":checked",".formerasemessage").each(function(){ $.ajax({ type: "post", url: "removemessage.php", data: {mensajes_id: "value"} }); if(jquery(this).is(':checked')) { c = true; o[cn] = jquery(this); cn++; } }); if(!c) { alert('no selected message'); } else { var msg = (o.length > 1)? 'messages' : 'message'; for(var a=0;a<cn;a++) { jquery(o[a]).parents('tr').remove(); } } }); } and have multiples divs, code send 1 value repeatedly depending on number of checkboxes select
i want send me value of each div select, not value of 1 div repeatedly
if(jquery('.delete').length > 0) { jquery('.delete').click(function(){ var c = false; var cn = 0; var o = new array(); jquery(":checked",".formerasemessage").each(function(){ $.ajax({ type: "post", url: "removemessage.php", data: {mensajes_id: jquery(this).val()} }); if(jquery(this).is(':checked')) { c = true; o[cn] = jquery(this); cn++; } }); if(!c) { alert('no selected message'); } else { var msg = (o.length > 1)? 'messages' : 'message'; for(var a=0;a<cn;a++) { jquery(o[a]).parents('tr').remove(); } } }); } you can use $(this).val() current node value easlly
Comments
Post a Comment