Click here to Skip to main content
14,543,534 members
Rate this:
Please Sign up or sign in to vote.
See more:
I am able to dynamically create and delete the row of a table, but I need that when I delete the row then the Id of input field should be in fix in order like P001. Suppose I have created a row and the id of "Item no" is P001 and again I created another row then the next id of "Item no" will be P001.it should be just duplicate of first cell input to newly added cell of input


What I have tried:


$(function () {
$("#btnAdd").click(function () {
$('#maintable td:first-child').live('click', function () {
$(this).closest('td:first-child').clone(true).appendTo('#maintable').
find('.txtsales');
});
});
});
Posted
Comments
F-ES Sitecore 18-Dec-19 6:05am
   
I don't understand the question, but ids have to be unique. If you duplicate them you will have some things that stop working as you intended.
shailendra verma 18-Dec-19 6:28am
   
i want to keep row id unique for every row ,id should not be change if i add 10 row id should be continue
P001
P001
P001
P001
P001
----

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100