I think the click event of your button wasn't bound to your function addRow
correctly.
Instead of binding the event from onclick="addRow(this.form)"
, try creating the click event as follows instead:
$(function() {
$("#mybutton").click(function() {
addRow($(this));
});
});
where mybutton
is your Add button:
<button type="button" class="btn btn-info btn-block" id="mybutton">Add</button>
Here's a Fiddle including the changes made: Fiddle
Have a try and let me know :)