I’m trying to delete db records from a “Delete” button within a modal and a Bootstrap 4 dynamic form. It’s an image gallery and I’m trying to delete a gallery and all the images included.
Full disclosure . . . I’m not very good at this coding stuff (which is why I chose Wappler). I appreciate all of the advice, tutorials and helpful people I meet in this community.
> <div class="modal-body">
> <form is="dmx-serverconnect-form" id="mdlGallery_Delete" method="post" action="../dmxConnect/api/Galleries/delete.php" dmx-generator="bootstrap4" dmx-form-type="horizontal" dmx-populate="ddGallery.data" dmx-on:success="scGalleries.load();mdlGalleryDelete.hide()">
> <input type="hidden" name="galleryID" id="input_galleryID" dmx-bind:value="ddGallery.data.galleryID"></form>
> <p>Are you sure you want to delete this gallery and ALL images inside? <br><br>This action cannot be undone.</p>
> </div>
> <div class="modal-footer">
> <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
> <button type="button" class="btn btn-danger">Delete Gallery</button>
> </div>
First, there is no end <form> tag after the paragraph.
Secondly, because the Delete button is outside of the form, you will need an on-click event to submit the form.