Is it possible to create a button at the end of a modal that closes it, but also redirects the user to a different page? Basically the modal has a disclaimer, where at the end the user has to "Agree" with the terms, which should close the modal, but also open up a different page.
Thank you!
Edit: this code should work in Bootstrap 4, unfortunately I couldn't find a Bootstrap 3 version.
<a href="link" class="btn btn-primary" target="_blank" data-dismiss="modal">I Agree</a>
Solved! Go to Solution.
Hi @AJ_devaccount - not at this time, please log an ENH request with support or post to ArcGIS Ideas. This way the community will be able to follow/upvote your request.
Hi @AJ_devaccount - not at this time, please log an ENH request with support or post to ArcGIS Ideas. This way the community will be able to follow/upvote your request.
Try this on Bootstrap 3 ..
<!-- Modal content -->
<div class="modal" id="myModal">
<div class="modal-dialog">
<div class="modal-content">
<!-- Modal body -->
<div class="modal-body">
<!-- Disclaimer content goes here -->
</div>
<!-- Modal footer -->
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<a href="link" class="btn btn-primary" id="agreeButton">I Agree</a>
</div>
</div>
</div>
</div>
<!-- Button to trigger the modal -->
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#myModal">Open Modal</button>
<!-- JavaScript to handle the "I Agree" button click -->
<script>
document.getElementById('agreeButton').addEventListener('click', function() {
// Redirect the user to the specified link
window.location.href = 'link';
});
</script>