简体   繁体   English

将文本框值从父页面传递到cfm中的子窗口

[英]passing textbox value from parent page to child window in cfm

I am passing text field value from parent cfm page to child window which I am opening after clicking button or link. 我将文本字段值从父cfm页面传递到我点击按钮或链接后打开的子窗口。

<form name="parentForm" action="">
    <input type="text" id="parentValue" value="" /> 
    <input type="button" value="Open Popup"  onclick ="javascript:LaunchPopup('openP.cfm');"/> 
</form>
<script type="text/javascript"> 
    function LaunchPopup(page) {
         OpenWin = window.open(page, "myWindow", "width=400,height=200"); 
    }
</script>


<!--- Child page : openp.cfm --->
<script>
    if (opener.document){
        mother = opener.document;
        document.form1.popupValue.value = mother.parentForm.parentValue.value;
    }
</script>
<form id="form1">
    Value from the calling page: <input type="text" id="popupValue" value="" />
</form>

But for some reason, i am not able to pass the value which i entered in parent page. 但由于某种原因,我无法传递我在父页面中输入的值。 after i click button, i want to see the value what i entered in parent page. 点击按钮后,我想看到我在父页面输入的值。

Parent page 父页面

<input 
    type="button" value="Open Popup"  
    onclick ="javascript:LaunchPopup('openP.cfm?parent=' + document.parentForm.parentValue.value);"
/> 

openp.cfm openp.cfm

<cfparam name="url.parent" default="">
<form id="form1">
    Value from the calling page: 
    <input type="text" id="popupValue" value="<cfoutput>#url.parent#</cfoutput>" />
</form>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM