I do not understand why but sometimes when I use .post() function the data are posted more than one time how can I control and stop this think? Thanks in advance.
best regards That's my code:
case "mod" :
$.post("./php/"+eti[indice]+".php",
{azione: "carica", contratto:contratto},
function(xml)
{
if ($("status", xml).text()=="1")
{
scorriDati(xml);
$.post("./php/"+eti[indice]+".php",
{azione: "vedi", contratto: contratto },
function(xml)
{
if ($("status", xml).text()=="1")
{
var lun=$("#"+eti[indice]+"_"+indice).length;
if (lun == 0)
{
$("#scheda_sch").append("<div style='clear:both'><div style='float:right' id='mod_def'><div id='"+eti[indice]+"_"+indice+"' class='bt'>modifica</div></div></div>");
scorriDati(xml);
}
}
else
{
$("#scheda_ris").html("<p><img src='./img/validyes.png' alt='ok'> Attenzione!<br>codice non trovato!</p>");
}
},'xml');
}
else
{
$(xml).find("errore").each(function()
{
$("#scheda_ris").append("<img src='./img/validno.png' alt='errore'> <span style='color:red'>"+$(this).text()+"<br></span>
");
});
}
},'xml'
);
break;
The problem is generated when I click on modifica, I get more than one button and data are posted several times..
ciao h