Sharing a variable between my page and lightbox


Looking for some help here. I have a lightbox form that needs to have different text in the title depending on which button was clicked to open the form.

My solution was to set a javascript variable with the text I want depending on which button is pressed (onclick) and then have the lightbox javascript read that variable and replace the text with the contents when it loads.

What I’ve run into, however, is that the lightboxes are spawned in kind of a sandbox and don’t seem to have access to javascript variable from the page?

Is that correct? Is there a way around that?