JavaScript: Calling actions of an object on the parent page from modal window
July 25, 2022 12:00 AM
I have a page built in Lectora v21 and it opens a modal window (also built in Lectora) in the middle of a page when a button is clicked, when I close that window I would like to do something with the objects on the parent's page such as disable a specific button. I remember in Flash there was a fairly easy way to do this, but since I am new to JS/JQuery I am a bit lost.
Ideally I'd like to be able to make a call similar to....
obj1234.actionHide();
obj1234.actionShow();
etc....
I remember being able to do this relatively easily in Adobe Animate, but as in my previous posts - I am still fairly green between the ears with JavaScript and the such.
Discussion (5)
Not to short-circuit your question, but if the window is modal and you always want the button disabled when the modal window closes ... why not just have your "open the modal window" button disable that other button immediately, before opening the new window? Same effect, no JS required.
Great idea, but there is more complex reasoning behind my over simplified question.
From a technical perspective: What is that modal window? A new browser window?
From a technical perspective: What is that modal window? A new browser window?
A "modal" window is one that blocks the original window, so you can't interact with it until you close the new window. For instance, if you click a "close" button without saving first, many programs cause a confirmation window to appear, and you can't click on or interact with the original window until you either click "Save" or "Close without saving".
From a technical perspective, it is a modal window. In Lectora I have created a new page and then I open it as a modal.
However, I have dug a bit deeper and forgot to post before heading on vacation that I tried the below and it worked OK...
parent.functionName();
parent.runGroup_og1234();