I am targeting "model-body" section to load the dynamically created table in update.php, but when i click on the edit button,nothing is happens and then page becomes hanged.Can someone please advise what is missing ?
<div class="modal fade" id="Modal1" aria-labelledby="Modal-Edit
Form" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Modal title</h5>
<button type="button" class="close" data-dismiss="modal" aria-
label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<table cellpadding="10px" width="100%" id="modal1">
</table>
</div>
<div class="modal-footer">
</div>
</div>
</div>
$(document).on("click", ".edit-btn", function(e) {
$("#Modal1").toggle("show");
var peid = $(this).data("eid");
$.ajax({
url: "update.php",
type: "POST",
data: {
id: peid
},
success: function(data) {
$("#Modal1 table").html(data);
}
});
});
$(document).on("click", ".edit-btn", function(e) {
$("#Modal1").toggle("show");
});
try this.