$(document).on('click','#updateexpendscategorysubmit',function() { var addcategoryname=$("#addcategoryname").val(); var expendsupdateid=$("#expendsupdateid").val(); $.ajax({ url:'action.php', type:'POST', data:{updatecategoryname:addcategoryname,expendsupdateid:expendsupdateid}, success:function(data){ $("#update_expends_all").html(data); } }); }); $(document).on('click','#addexpendscategorysubmit',function() { var addexpendscategoryval=$("#addcategoryname").val(); $.ajax({ url:'action.php', type:'POST', data:{addexpendscategoryval:addexpendscategoryval}, success:function(data){ $("#add_expends_all").html(data); } }); }); $(document).on('click','.clickexpendsxategory',function() { if(confirm("Are You Confirm")) { var expendsxategoryremovegetid=$(this).attr("removeid"); $.ajax({ url:'action.php', type:'POST', data:{expendsxategoryremovegetid:expendsxategoryremovegetid}, success:function(data){ $("#deleteexpendscategoryid").html(data); } }); } }); $(document).on('click','.removeexpendsrow',function() { $(this).closest("tr").remove(); }); $(document).on('click','#addexpensesrowid',function(e) { e.preventDefault(); var count=$("#dynamic_field tr").last().length; if(count == '0') { var n=0; } else { var n=$("#dynamic_field tr").last().attr("count"); } var m=1; var i= parseInt(m, 10) + parseInt(n, 10); $('#dynamic_field').append('