with the following jQuery my modal form opens from the custom datable button.
Code: Select all
dom: 'Bfrtip',
buttons: [
{
text: 'New Item',
action: function ( e, dt, node, config ) {
home()
}
},
Code: Select all
function home(){
$('#myModal').modal('show')
}
But if I open the modal form from the following button
Code: Select all
<button type='button' class='btn bd-yellow-500'data-toggle='modal' data-target='#myModal'><i class="fas fa-user-plus"></i> New Item</button>
follwing is the code for the close button
Code: Select all
<!-- Modal Header -->
<div class="modal-header">
<h2>Item Details</h2>
<button type="button" id="btn-close" class="close" data-dismiss="modal" onclick="clearForm();">×</button>
</div>