I am trying to add a dynamic form inside a table row. Below is my code.
$(`#event_draw_table`).append(`
<tr>
<form method="post" action="">
<td><input type="text" name="addmore[0][name]" placeholder="Draw Name" class="form-control" /></td>
<td><input type="text" name="addmore[0][price]" placeholder="Start" class="form-control" /></td>
<td><input type="text" name="addmore[0][price]" placeholder="End" class="form-control" /></td>
<td>
<button type="submit" name="add" id="save_draw" class="btn btn-sm btn-success">Save</button>
<button type="button" name="add" id="add" class="btn btn-danger">Remove</button>
</td>
</form>
</tr>
`);
The above code is working fine and table row is getting append but the problem I am facing is that the form element is blank.
all my td elements are not getting wrapped inside form element. how to fix it?
Below is my html code.
<tbody id="event_draw_table">
<tr>
<td><input type="text" name="addmore[0][name]" placeholder="Draw Name" class="form-control" /></td>
<td><input type="text" name="addmore[0][price]" placeholder="Start" class="form-control" /></td>
<td><input type="text" name="addmore[0][price]" placeholder="End" class="form-control" /></td>
<td>
<button type="submit" name="add" id="save_draw" class="btn btn-sm btn-success">Save</button>
<button type="button" name="add" id="remove_draw" class="btn btn-sm btn-danger">Remove</button>
</td>
</tr>
</tbody>