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:
- Define a JavaScript function that calls the showModal function with the name of your modal.
function showMyModal() { showModal('myModal');}
- In your modal configuration, toggle the "run onPageLoad" option to ON.
Screenshot_2022-06-14_at_6.10.42_PM.png
- 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.