View Single Post
  #41 (permalink)  
Old 02-21-2008, 01:39 AM
prasannavigneshr prasannavigneshr is offline
D-Web Incredible
 
Join Date: Feb 2007
Posts: 1,321
prasannavigneshr is on a distinguished road
Send a message via MSN to prasannavigneshr
Thumbs up ColdFusion Tips & Tricks - Passing information from a child window to the parent win

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()                                        
}
__________________
Prasanna Vignesh
MCPD | Web Developer
Reply With Quote
Sponsored Links