php - Deleting a particular row using jQuery -
i working web app creating invoice items purchased. in invoice having lines additional charges transportation , other services, can leave them blank , not produce tax. have provided delete provision same. when click on delete deleting rows, tax % summary has record of 0% tax unnecessarily. using jquery same. here code :
this how calling , below function:
<label class="btn btn-default" name="delrow<?php echo $cnt;?>" id="delrow<?php echo $cnt;?>" onclick="delverycdel(<?php echo $cnt; ?>); function delverycdel(a) { var count = $("#count").val(); var hsncode22 = $("input[name='hsnper[]']").length; console.log("hsncode : "+hsncode22); if(count>1) { $("taxc"+a).remove(); var elem = document.getelementbyid("taxc"+a); elem.parentnode.removechild(elem); var tc = parseint(count)-1; $("#count").val(tc); setdefault(a, "xyz"); return false; } }
please help. thanks.
you removing element again element id. undefined search child first remove both
if(count>1) { var elem = document.getelementbyid("taxc"+a); $("taxc"+a).remove(); // add remove here elem.parentnode.removechild(elem); var tc = parseint(count)-1; $("#count").val(tc); setdefault(a, "xyz"); return false; }
Comments
Post a Comment