Answer the question
In order to leave comments, you need to log in
Why doesn't each() see new table rows?
Hello!
Using append() I add rows to the table, after which the maximum value in the column is searched
var cv = 0, max = 0;
$('.border_options table tbody tr.option_item').each(function(){
cv = parseInt($('td.sort input', this).val());
max = max < cv ? cv : max;
});
$('#finp_add_sort').val(max+1); // это поле формы для добавления новой строки
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question