I have a table in which I attach the rows to the onclick event, the row contains a button that lets you delete it Enables it. It works fine. The problem comes when I have inserted 5 rows in some rows, and when I delete any row on the first and last lines, then it combines two consecutive rows, the previous row is duplicated with the counter value of the previous row .
My question is, how do I add the value of the last line, so that I want to increase it in any line by adding it without duplicate values
here is the code
HTML
& Lt; Td width = "76%" & gt; & Lt; Strong & gt; Attributes & lt; / Strong> & Lt; / Td> & Lt; Td width = "20%" & gt; & Lt; Strong & gt; AMOUNT & lt; / Strong> & Lt; / Td> & Lt; / TR & gt; & Lt; / Table & gt; & Lt; Input type = "button" id = "button" value = "add field" /> & Lt; / Form & gt;
JS
& lt; Script type = "text / javascript" & gt; Click on $ ('# button') (function () {var count = $ ('input.dasa'). Length; // html to create a new field ' & lt; / td>' + ' & lt; input type =" text " Name = "zodiac" + count + '"id =" zodiac' + count + '"/ ' + '
Comments
Post a Comment