Passing information from a child window to the parent window
The child window can refrence the information in the parent window using the "opener" name in the child window.
Attached is the code I have in passing date information between two forms. Note in this case that I'm required to use three fields, one each for Month, Day, and Year.
Example HTML/CFML code: Code:
<!--- Child window Javascript --->
function chooseDate()
{
var day = window.status
var dateOne = this.month + 1;
if (Number(day) < 10)
{
day = Number(day);
day = '0' + day;
}
if (Number(dateOne) < 10)
{
dateOne = Number(dateOne);
dateOne = '0' + dateOne;
}
this.day = day
this.dateOne = dateOne
this.dateFieldm = opener.dateFieldm;
this.dateFieldd = opener.dateFieldd;
this.dateFieldy = opener.dateFieldy;
dateFieldm.value = dateOne;
dateFieldd.value = this.day;
dateFieldy.value = this.year;
window.close()
}