Skip to content

Commit

Permalink
footer.php: reset values in all modals after they are hidden
Browse files Browse the repository at this point in the history
If a modal is hidden or dismissed (cancelled), any modified (but unsaved) values persist when the modal is opened again with the same record.
  • Loading branch information
nellistc authored Nov 6, 2023
1 parent 210530e commit f07cd1f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@
</div>
<!-- ./wrapper -->

<!-- reset values in modals after hiding/dismissal -->
<script>
$(document).ready(function() {
$('body').on('hidden.bs.modal', '.modal', function () {
// reset the form
$(this).find('form').trigger('reset');
});
});
</script>

<!-- REQUIRED SCRIPTS -->

<!-- Bootstrap 4 -->
Expand Down

0 comments on commit f07cd1f

Please sign in to comment.