Tim Do wrote:
> 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.
[snip]
> 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#">
It looks like you're defining the path to the parent object just fine. But,
unless it's a typo, the code for accessing the child object is incorrect.
The child object form field name is "actionReasonCode" contained in a form
named "actionCode." But your JS code refers to it as:
document.actionReason.actionReasonCode.value
^^^^^^^^^^^^
This should be actionCode as in:
document.actionCode.actionReasonCode.value
--
Mosh Teitelbaum
evoch, LLC
Tel: (301) 625-9191
Fax: (301) 933-3651
Email: [EMAIL PROTECTED]
WWW: http://www.evoch.com/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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
Signup for the Fusion Authority news alert and keep up with the latest news in
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm