Open a Lightbox with button from dynamic page

First, make sure that you are using the Name of the Lightbox, and not the Lightbox ID.

I’m not sure that the onClick() as you have it defined will get the proper Lightbox name. I suspect that you might have to save the name in a global variable, or use wix-storage to save it for later. You can then call openLightbox() with the name that you saved.

As you mention at the end of your post, populating the field by sending the data to the Lightbox is the best option. See the openLightbox() API for information on how to send data to a Lightbox. See the Lightbox’s getContext() API to see how to get the data that was passed to the Lightbox.