# Opening a Lightbox not working

**URL:** <https://forum.wixstudio.com/t/opening-a-lightbox-not-working/15424>\
**Category:** Ask the community\
**Tags:** question, code\
**Created:** [March 28, 2019, 2:17pm UTC](https://forum.wixstudio.com/t/opening-a-lightbox-not-working/15424 "2019-03-28T14:17:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dan-weiss42](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/dan-weiss42/32/2467_2.png) [@dan-weiss42](https://forum.wixstudio.com/u/dan-weiss42)\
**Post date:** [March 28, 2019, 2:17pm UTC](https://forum.wixstudio.com/t/opening-a-lightbox-not-working/15424/1 "2019-03-28T14:17:40Z")

</div>

This should be easy but i cant get it to work. I even copied the code from the API and have no results.

Picking a value from a dropdown menu then clicking a button should trigger the lightbox to open but im getting nothing:

import wixData **from** ‘wix-data’;  
import wixWindow **from** ‘wix-window’;  
:  
: //some other code here  
:  
export function button5\_click(event) {  
//Add your code for this event here:  
**if** ($w(‘#dropdown1’).value === ‘vanilla’)  
(wixWindow.openLightbox(‘lightbox1’)  
)}

Any suggestions? What stupid mistake have I made?

---

<div class="post-metadata">

**Author:** ![yisrael-wix](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/yisrael-wix/32/1107_2.png) [@yisrael-wix](https://forum.wixstudio.com/u/yisrael-wix)\
**Post date:** [March 28, 2019, 2:34pm UTC](https://forum.wixstudio.com/t/opening-a-lightbox-not-working/15424/2 "2019-03-28T14:34:48Z")

</div>

A Lightbox is opened using the Lightbox name and not the id:

**This** :  
wixWindow.openLightbox(“LightboxName”);  
**Not** this:  
wixWindow.openLightbox(“#lightbox1”);

---

<div class="post-metadata">

**Author:** ![dan-weiss42](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/dan-weiss42/32/2467_2.png) [@dan-weiss42](https://forum.wixstudio.com/u/dan-weiss42)\
**Post date:** [March 28, 2019, 2:49pm UTC](https://forum.wixstudio.com/t/opening-a-lightbox-not-working/15424/3 "2019-03-28T14:49:48Z")

</div>

Yup that was the stupid mistake! Thank you very much

---

<div class="post-metadata">

**Author:** ![elaine-cadman](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/elaine-cadman/32/32176_2.png) [@elaine-cadman](https://forum.wixstudio.com/u/elaine-cadman)\
**Post date:** [December 16, 2022, 3:42pm UTC](https://forum.wixstudio.com/t/opening-a-lightbox-not-working/15424/4 "2022-12-16T15:42:13Z")

</div>

Glad I stumbled upon this, strange that they set it up this way!
