# Javascript closing a greybox window



## frat78 (Oct 28, 2009)

Anthony, how about passing a value from the greybox page back to the parent while still preserving the form field entries on the parent page? I have the users choosing a value from a large list in greybox which will populate a textbox on the parent, but there are many other form fields on the parent page, which all get reset if it is refreshed. Any ideas? Thanks!


----------



## Anthony:-P (Nov 24, 2006)

Hi frat78,

Welcome to TSG! In order to help you find a solution to your problem it's always best to start a new topic - many of the helpers here at TSG look for zero reply posts in order to provide answers / help / advice; so you have more chance of being seen that way.

I'll ask a moderator to split this topic and then I'll post some code to do as you wish 

Many thanks,
A.. :up:


----------



## frat78 (Oct 28, 2009)

Thanks so much Anthony! Any code you can provide would be greatly appreciated!

Ken


----------



## Anthony:-P (Nov 24, 2006)

frat78,

Sorry for the delay in replying!

The following should work:

```
function PopupFindMemberReturn(CID, Itm){
	parent.parent.document.getElementById(Itm).value = CID;
	parent.parent.GB_hide();
}
```
Whereby CID = the value you're returning (in this case the ID of the row in the database) and Itm = the element on the page (outside of greybox) that you want a value set to 

Regs,
A... :up:


----------



## frat78 (Oct 28, 2009)

That worked. Thanks Anthony!


----------

