0
I have a code when the person clicks add the code generates other languages.. but how do I have the option to delete in each form? Note: I do not want to delete the last one added and yes a certain.
var counter = 1;
jQuery('a.add-author').click(function(event){
event.preventDefault();
counter++;
var newRow = jQuery('<tr><td><input type="text" name="first_name' +
counter + '"/></td><td><input type="text" name="last_name' +
counter + '"/></td></tr>');
jQuery('table.authors-list').append(newRow);
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.1/jquery.min.js"></script>
<table class="authors-list">
<tr><td>author's first name</td><td>author's last name</td></tr>
<tr><td><input type="text" name="first_name" /></td><td><input type="text" name="last_name" /></td></tr>
</table>
<a href="#" title="" class="add-author">Add Author</a>
And to disable the remove button on the first item? In case remove only appears from the second?
– Lucas Fonseca