3
I have this form:
jQuery
(function($) {
AddTableRow = function() {
var newRow = $("<tr>");
var cols = "";
cols += '<td><input type="text" name="dados[][nome]" id="dados[][nome]" class="form-control" value=""></td>';
cols += '<td><input type="text" name="dados[][nome]" id="dados[][nome]" class="form-control" value=""></td>';
cols += '<td><input type="text" name="dados[][nome]" id="dados[][nome]" class="form-control" value=""></td>';
cols += '<td><input type="text" name="dados[][nome]" id="dados[][nome]" class="form-control" value=""></td>';
cols += '<td>';
cols += '<button onclick="RemoveTableRow(this)" type="button"><span class="fa fa-minus"></button></button>';
cols += '</td>';
newRow.append(cols);
$("#convidados-table").append(newRow);
return false;
};
})(jQuery);
To better understand, I modified the code... How I would make this adjustment to array?
The ID you can take, it can never repeat itself on the page. When you clone the line will duplicate the ID.
– Diego Souza