Tim,

window.opener is the parent object.  You can set any form element from the child 
window using the Javascript statement window.opener.formname.inputelementname.value = 
document.formname.fieldname.value;

I hope this helps.


---------- Original Message ----------------------------------
From: Tim Do <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
Date:  Fri, 18 Oct 2002 08:28:09 -0700

>Could anybody show me how I would pass values from a child window back to
>the parent window?  I have a form with a link that spawns a window, and from
>the new page, the user selects  some checkboxes.  I wanted to pass the
>values back into a form field in the parent window.  I'm getting an error
>message that says the parent window's form field is null or not an object.
>
>Here is what I have:
>
>Parent Window:
>
><FORM NAME="newCaseInfo"
>ACTION="index.cfm?action=caseAnalysis&subaction=createNewCase" METHOD="POST"
>onSubmit="return validateUnits();">
>
>Form that I'm trying to populate with Child window data:
><INPUT TYPE="text" NAME="actionReason" VALUE="" SIZE="5">  <A
>HREF="javascript:openFrameless2()" CLASS="text9ptBlack">Codes</A>
>
>
>Child Window:
>
><SCRIPT LANGUAGE="JavaScript">
>function passToParent()
>{
>       window.opener.document.newCaseInfo.actionReason.value =
>document.actionReason.actionReasonCode.value;
>       return false;
>       window.close();
>}
></SCRIPT>
>
><FORM NAME="actionCode"
>ACTION="index.cfm?action=caseAnalysis&subaction=createNewCase" METHOD="POST"
>onSubmit="return passToParent();">
>
><INPUT TYPE="checkbox" NAME="actionReasonCode" VALUE="#actionReasonCode#">
>
>
>
>Thanks
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm

Reply via email to