I have one row with input fields in table and user can add new rows (copy of first) by clicking button.
Script to adding new row:
var row = '<tr><td>'+number+'</td>'+f1+f2+f3+f4+f9+f5+f6+f7+f8+'</tr>';
$('#table').find('#tbody').append(row);
In first row I can do some calculations with data in inputs but in added i can’t do anything.
Script for calcs:
$(document).ready(function(){
$('input[name="name['+rowSelected+']"]).delegate('keyup',{}, function(){
some calculations
});
I’m trying with .delegate and .live without success. I need help to solve this problem.
This is how you would use
.on()for handling of dynamically addedinputtags in the table:You can adjust the
'input'selector if you need to narrow it to only some of the input tags in the table.For
.on(), you use this form: