Close Cfwindow and send value to parent

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>
 
<cflayoutarea name="left" position="left" closable="false" collapsible="true" splitter="true" style="height:100%; width:180px;">
 
</cflayoutarea>
 
<cflayoutarea name="center" position="center" style="height:100%;" >
 
</cflayoutarea>
 
 
<cflayoutarea name="right" position="right" closable="false" collapsible="true" splitter="true" style="height:100%; width:850px;">
 
<cfajaximport tags="CFFORM,CFINPUT-DATEFIELD,CFDIV,CFWINDOW">
 
 
<cfform>
<cfinput type="text" name="mytext">
</cfform>
 
 
 
</cflayoutarea>
 
</cflayout>
 
 
 
************ 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

quarkmikeAsked:
Who is Participating?
 
SidFishesConnect With a Mentor Commented:
try this
<script type="text/javascript">	
function showSelectTeam(){
		
		myWindow = ColdFusion.Window.getWindowObject('selectteam');
		myWindow.hide();
		myWindow.center();
	    myWindow.show();
}
function selectTeam()
{
document.getElementById('teamid').value=selectTeam.arguments[0]
document.getElementById('displayTeam').innerHTML='Selected Team Is: ' + selectTeam.arguments[0]
myWindow = ColdFusion.Window.getWindowObject('selectteam');
		myWindow.hide();
}
 
</script>	
<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>
			</cfwindow> 

Open in new window

0
All Courses

From novice to tech pro — start learning today.