Select to view content in your preferred language

On Load Open Modal

1257
3
07-08-2019 03:29 PM
KirstenFrost_Andersen
Regular Contributor

I'm attempting to add a disclaimer pop-up to our Open Data hub.  I added the below code to a Text Card per the instructions, but I'm not sure how to get it to pop-up on page load.  Apparently javascript code isn't allowed on a Text Card.  Has anyone been able to make something like this work on their data Hub?

<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="myModalLabel">Commercial Purposes Disclaimer</h4>
</div>
<div class="modal-body">
(1) RCW 42.56.070(9) prohibits the release of l.... 
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">I Agree</button>
</div>
</div>
</div>
</div>
0 Kudos
3 Replies
KlaraSchmitt
Esri Regular Contributor

Hello Kirsten,

We currently do not support modal dialogs that trigger from an onLoad event and you are correct that we block javascript from our text cards. We do this to mitigate the security risk of having malicious code injected and also because people used to load in duplicative instances of jQuery or Bootstrap.js that would collide with our files and cause things like dropdown menus not to work correctly.

We do have a feature for this on our backlog, but I cannot give you an answer for when it'll be included in the product. I, will, however add your request to the issue. In the meantime, is it possible to present that information in an info alert at the top of the page? If you were to use a custom header, you could even position it right near the top. I see a number of alerts around cookies these days that do not require explicit consent and are worded such that if I continue to use the page, I am agreeing to have cookies track my movement.

0 Kudos
KirstenFrost_Andersen
Regular Contributor

Thank you Klara, for your insight. I will recommend the alert header, however ultimately that will not satisfy our lawyers who insist we need an acknowledged disclaimer that our data won’t be used for commercial purposes and we can’t be held liable otherwise. Looking forward to when something can be implemented to address this need!

0 Kudos
NFlourish
Frequent Contributor

Hi! I just saw this post. It is very similar to in concept to another post I answered.

https://community.esri.com/thread/235221-disclaimer-acceptance-on-open-data-site 

0 Kudos