Fixes small workflow changes with update modals

- prevents form elements from refreshing the page or submitting requests
- ensures that the submit buttons for modals will close the modal,
  insead of just spawning a page refresh
This commit is contained in:
Ariana Giroux 2022-08-04 17:30:27 -06:00
parent 44b51e531a
commit 13f8648fb7
1 changed files with 4 additions and 4 deletions

View File

@ -56,13 +56,13 @@
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<form onsubmit="updateStreamTitle(document.getElementById('streamTitleInput').value)" style="width:100%" id="streamTitleForm">
<form onsubmit="updateStreamTitle(document.getElementById('streamTitleInput').value); return false" style="width:100%" id="streamTitleForm">
<input type="text" name="streamTitle" id="streamTitleInput" style="width:100%" />
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
<button type="button submit" form="streamTitleForm" class="btn btn-primary">Save changes</button>
<button type="button submit" form="streamTitleForm" class="btn btn-primary" data-bs-dismiss="modal">Save changes</button>
</div>
</div>
</div>
@ -78,14 +78,14 @@
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<form onsubmit="updateTags(document.getElementById('tagsInput').value)" style="width:100%" id="tagsForm">
<form onsubmit="updateTags(document.getElementById('tagsInput').value); return false" style="width:100%" id="tagsForm">
<input type="text" name="tagsInput" id="tagsInput" style="width:100%" />
</form>
<p class="small text-center">Seperate tags by comma.</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
<button type="button submit" form="streamTitleForm" class="btn btn-primary">Save changes</button>
<button type="button submit" form="tagsForm" class="btn btn-primary" data-bs-dismiss="modal">Save changes</button>
</div>
</div>
</div>