Atozed Forums
How to close modal window when clicking on the background form - Printable Version

+- Atozed Forums (https://www.atozed.com/forums)
+-- Forum: Atozed Software (https://www.atozed.com/forums/forum-1.html)
+--- Forum: IntraWeb (https://www.atozed.com/forums/forum-3.html)
+---- Forum: English (https://www.atozed.com/forums/forum-16.html)
+----- Forum: IntraWeb General Discussion (https://www.atozed.com/forums/forum-4.html)
+----- Thread: How to close modal window when clicking on the background form (/thread-22.html)



How to close modal window when clicking on the background form - davenovo - 03-19-2018

Hello,

Making a modal window is quite straightforward as per your demo. Quick question. I have seen several websites where clicking on the non-modal part of the web page is effectively doing a cancel on the modal form. Is there an easy way to accomplish this in intraweb?


RE: How to close modal window when clicking on the background form - Fabio Brabo - 03-20-2018

Do it with JavaScript:

window.onclick = function(event) {
var modal = document.getElementById("modalName");
if (event.target == modal) {
modal.style.display = "none";
}
}