Hello,
I have created textboxes dynamically using jquery please see my HTML code below.
Please help me to add values of textboxes in database on button click.
HTML Code:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<link href="NewFolder1/bootstrap.min.css" rel="stylesheet" />
<script src="NewFolder1/jquery.min.js"></script>
<script src="NewFolder1/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
<form id="form1" runat="server">
<div class="input-group control-group after-add-more">
<input type="text" name="addmore[]" class="form-control" placeholder="enter text" />
<input type="text" name="addmore[]" class="form-control" placeholder="enter text" />
</div>
<div class="input-group-btn">
<button class="btn btn-success add-more" type="button">Add</button>
<button class="btn btn-info add-more" type="button">Save</button>
</div>
</form>
<div class="copy d-none">
<div class="control-group input-group" style="margin-top:10px">
<input type="text" name="addmore[]" class="form-control" placeholder="enter text" />
<input type="text" name="addmore[]" class="form-control" placeholder="enter text" />
<div class="input-group-btn">
<button class="btn btn-danger remove" type="button">Remove</button>
</div>
</div>
</div>
</div>
<script type="text/javascript">
$(document).ready(function () {
$(".add-more").click(function () {
var html = $(".copy").html();
$(".after-add-more").after(html);
});
$("body").on("click", ".remove", function () {
$(this).parents(".control-group").remove();
});
});
</script>
</body>
</html>