# Update Page On Lightbox Close?

**URL:** <https://forum.wixstudio.com/t/update-page-on-lightbox-close/12489>\
**Category:** Ask the community\
**Tags:** question, code\
**Created:** [January 31, 2019, 3:03pm UTC](https://forum.wixstudio.com/t/update-page-on-lightbox-close/12489 "2019-01-31T15:03:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![walkwithhutch](https://avatars.discourse-cdn.com/v4/letter/w/fbc32d/32.png) [@walkwithhutch](https://forum.wixstudio.com/u/walkwithhutch)\
**Post date:** [January 31, 2019, 3:03pm UTC](https://forum.wixstudio.com/t/update-page-on-lightbox-close/12489/1 "2019-01-31T15:03:09Z")

</div>

Hello!  
I’m having a user upload a file via a lightbox window, when the lightbox window closes, I would like to refresh a dynamic dataset on the page.

Is there a way to have the lightbox communicate with the base page so that I can update the data on lightbox close?

Thanks!

---

<div class="post-metadata">

**Author:** ![mikemoynihan99](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/mikemoynihan99/32/5930_2.png) [@mikemoynihan99](https://forum.wixstudio.com/u/mikemoynihan99)\
**Post date:** [January 31, 2019, 6:59pm UTC](https://forum.wixstudio.com/t/update-page-on-lightbox-close/12489/2 "2019-01-31T18:59:51Z")

</div>

just add code to your lightbox to refresh the page and then close the lightbox

**import** wixLocation **from** ‘wix-location’;  
**import** wixWindow **from** ‘wix-window’;

$w.onReady( **function** () {

//add an event here such as an onClick to trigger the page refresh and lightbox close

[wixLocation.to](http://wixlocation.to/) (wixLocation.url);

wixWindow.lightbox.close();

})

---

<div class="post-metadata">

**Author:** ![brettfranklin2](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/brettfranklin2/32/3944_2.png) [@brettfranklin2](https://forum.wixstudio.com/u/brettfranklin2)\
**Post date:** [January 31, 2019, 11:00pm UTC](https://forum.wixstudio.com/t/update-page-on-lightbox-close/12489/3 "2019-01-31T23:00:50Z")

</div>

Another idea is after the user uploads the file the user is directed to a success page saying thank you for uploading, then there‘S a button on the success page that says see results or whatever is being displayed in the database and its linked to that page. So it can act as a way to refresh the page and as a success message without using code. Make sure the success page is a dynamic page because it doesn’t work with regular pages.
