.post .....can you remove an entry?
- $(".AddBroken").click(function(){
- var id = $(this).attr("id");
- var html = "<div class=\"drug Broken\" id=\"" + id + "\"><p style='font-size: 16pt;'>1 Broken Vial/Amp <img src=\"Remove.png\" class=\"remDrug\" value=\"Remove\" /></p></div>";
- $("#b" + id).append(html);
- });
-
- $(".remDrug").live("click",function(){
- $(this).parent().remove();
- });
- $(".Broken").each(function(){
- var drugid = $(this).attr("id");
- var broken = 1;
- var me = $(this);
- $.post("reportusage_script.php",{type: 'Broken', drug: drugid, broken: broken}, function(data){
- html += data;
- me.remove();
- $("#results").html(html);
- });
- });
SO this code allows a user to click on the page and it will add 1 vial broken each time. This is only snipits of the WHOLE code but this is the only problem.
and the problem it that id you try to remove one broken because you added too many. the post still captures the data.
is there a way to remove the data from the post when removing the html from the page?