Close Cfwindow and send value to parent

Posted on 2009-02-19
Last Modified: 2012-05-06
Hi there,

I try to close a cfwindow and put value set in a href to a field in parent page.

please see the code below
************ Parent page ************

<cflayout name="thelayout" type="border">

<cflayoutarea name="top" position="top" size="100" splitter="false" style="height:100%;">


<cflayoutarea name="left" position="left" closable="false" collapsible="true" splitter="true" style="height:100%; width:180px;">


<cflayoutarea name="center" position="center" style="height:100%;" >


<cflayoutarea name="right" position="right" closable="false" collapsible="true" splitter="true" style="height:100%; width:850px;">



<cfinput type="text" name="mytext">




************ The cfwindow ************

<a href="Team1">Please click to choose the Team 1</a>

<a href="Team2">Please click to choose the Team 1</a>

Open in new window

Question by:quarkmike
    1 Comment
    LVL 36

    Accepted Solution

    try this
    <script type="text/javascript">	
    function showSelectTeam(){
    		myWindow = ColdFusion.Window.getWindowObject('selectteam');
    function selectTeam()
    document.getElementById('displayTeam').innerHTML='Selected Team Is: ' + selectTeam.arguments[0]
    myWindow = ColdFusion.Window.getWindowObject('selectteam');
    <input type="text" disabled id="teamid" name="teamid">
    <div id="displayTeam"></div>
    <button onclick="showSelectTeam();">Select Team</button>
    <cfwindow initShow="false" center="true"  modal="true" closable="true" 
    name="selectteam" width="500" height="100"
    			 title="Select Team" bodyStyle="text-align:center;">
    			 <button onclick="selectTeam(1);">Team 1</button>
    			 <button onclick="selectTeam(2);">Team 2</button>

    Open in new window


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Javascript: Crash Course

    Javascript is not only emerging as the most important language to know, it's flexibility is unique. With Javascript being deployed on the web, mobile and even the desktop this is the one language that all technologists need to know.

    Today, I was working on some optimization and spam-stopping techniques when I encountered Ben Nadel's post to reduce spam feature using Math ( While this method is not o…
    This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
    The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
    The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now