I want to append and remove rows to a table dynamically in a form. jquery for appending the tr is applied. But when i add or delete rows the form is submitting without click the submit button. Here is my code`
<html>
<head>
<script type="text/javascript" src="jquery.min.js"></script>
<script>
$(document).ready(function(){
$('#add').click(function(){
i=1;
var row="<tr><td><input type='checkbox' />";
row+="</td><td><input type='text' name='bundle[]' id='bnd"+i+"' /></td>";
row+="<td><input type='number' name='scripts[]' id='script"+i+"' min='1' /></td></tr>";
i++;
$('#bundle').append(row);
});
$('#remove').click(function(){
$("#bundle input:checkbox:checked").closest('tr').remove();
});
});
</script>
<style>
td
{
padding-left:8px;
height:30px;
}
input[type=number]
{
width:60px;
}
</style>
</head>
<body>
<div id="details">
<form method="post" action="test1.php" id="form">
  <button id="add">+Add</button>    <button id="remove">- Remove</button>
<table id="bundle">
<tr><td width='30px'></td><td width="200px">Bundle No.</td><td>No. of scripts</td></tr>
<tr><td><input type='checkbox' /></td>
<td><input type='text' name='bundle[]' /></td>
<td><input type='number' name='scripts[]' min='1' /></td>
</tr>
</table>
<br>
<center><input type="submit" id="submit" value="submit" /></center>
<br>
</form>
</div>
</body>
</html>