# Filter Repeater by putting Check box on a light box

**URL:** <https://forum.wixstudio.com/t/filter-repeater-by-putting-check-box-on-a-light-box/38293>\
**Category:** Ask the community\
**Tags:** question, code\
**Created:** [July 2, 2021, 12:02am UTC](https://forum.wixstudio.com/t/filter-repeater-by-putting-check-box-on-a-light-box/38293 "2021-07-02T00:02:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![upnadamadventures](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/upnadamadventures/32/29036_2.png) [@upnadamadventures](https://forum.wixstudio.com/u/upnadamadventures)\
**Post date:** [July 2, 2021, 12:02am UTC](https://forum.wixstudio.com/t/filter-repeater-by-putting-check-box-on-a-light-box/38293/1 "2021-07-02T00:02:05Z")

</div>

I have a repeater linked to a database collection and want to filter it using Check boxes. I want the filter selection check boxes to be on a light box so they do not clutter up the repeater page. I have the following code that works well on the repeater page but when i place this code on the light box it can not find the repeater because the repeater is not on the light box. Highlighted section is the problem. Is there some code I could put here to tell it to look for the repeater on another page?

**import** wixData **from** ‘wix-data’ ;

export function Filter1\_click ( event ) {  
search ();  
}

**function** search () {

```
wixData . query ( "Trails" ) 

```

. contains ( “featureTag” , String ( $w ( “#checkboxFeature1” ). value ))  
. and ( wixData . query ( “Trails” ). contains ( “routeTypeTag” , String ( $w ( “#checkboxTrailtype1” ). value )))

. find ()  
. then ( results =\> {  
$w ( “#repeatertrails” ). data = results . items ;  
});

}

---

<div class="post-metadata">

**Author:** ![tony-brunsman](https://avatars.discourse-cdn.com/v4/letter/t/ea5d25/32.png) [@tony-brunsman](https://forum.wixstudio.com/u/tony-brunsman)\
**Post date:** [July 2, 2021, 2:46am UTC](https://forum.wixstudio.com/t/filter-repeater-by-putting-check-box-on-a-light-box/38293/2 "2021-07-02T02:46:24Z")

</div>

Adam, what you could do is capture the checkbox values in a function that closes the lightbox and pass those values back to the page with the repeater.

```javascript
export function btnOk_click(event) {
     let chkBoxObj = {
         "Feature":String($w("#checkboxFeature1").value),
         "Trailtype":String($w("#checkboxTrailtype1").value)
     };
    wixWindow.lightbox.close(chkBoxObj);
}

```

Back in the page that you’re calling the lightbox from, it would be something like this:

```javascript
wixWindow.openLightbox("Name of Lightbox")
.then((data) => {
   if (data) {   
     // Put query code here using the object values from the lightbox (data.Feature 
     and data.Trailtype)
   }
})

```
