Category: How do I do X?
Updated

This solution is summarized from an archived support forum post. This information may have changed. If you notice an error, please let us know in Discord.

How do I show Modal onPage load?

Issue

As a member of the community, I am wondering how I can show a modal on page load.

Resolution

To show a modal on page load, we can use a JavaScript function to call the showModal function with the name of the modal we want to display. We can then toggle the "run onPageLoad" option under the settings tab to run our JavaScript function when the page loads.

Here is an example of how we can implement this solution:



  1. Define a JavaScript function that calls the showModal function with the name of your modal.


function showMyModal() {
showModal('myModal');
}



  1. In your modal configuration, toggle the "run onPageLoad" option to ON.

Screenshot_2022-06-14_at_6.10.42_PM.png



  1. Save your changes and preview the page to see the modal displayed automatically on page load.

Note that you will need to replace "myModal" with the name of your actual modal in the JavaScript function above. You can also add any additional customization or logic to this function as needed.