Hi bec.!
You can't avoid the alert box - it's a safety feature. Assuming you have
nothing untoward displayed from your Application.cfm or OnRequestEnd.cfm
pages, on the parent page write something like this:
<CFSETTING ENABLECFOUTPUTONLY="Yes">
<CFSET Local.TemplateID="ID: /dbabbitt-test/parent.cfm, v1.0.0 10/14/2001
8:07:05 PM dbabbitt">
<CFOUTPUT><!--
#Local.TemplateID#
-->
</CFOUTPUT>
<!---
Description:
This template displays the link to the popup window.
--->
<CFSET Variables.WindowURL="child.cfm">
<CFSET Variables.WindowWidthIs="340">
<CFSET Variables.WindowHeightIs="35">
<CFOUTPUT><HTML>
<HEAD>
<META HTTP-EQUIV="Pragma" CONTENT="no_cache">
<CFHEADER NAME="Expires" VALUE="#Now()#">
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
function newWindow(windowURL, windowWidth, windowHeight) {
/* creates a new resizable, centered window that
can
be closed and reopened without spawning
errors. */
var windowLeft = (screen.availWidth - windowWidth)/2;
var windowTop = (screen.availHeight - windowHeight)/2;
var newWindow = window.open(windowURL, "Link",
"toolbar=0, location=0,
directories=0, status=0, menubar=0, scrollbars=0, resizable=1, width=" +
windowWidth + ", height=" + windowHeight + ", left=" + windowLeft + ", top="
+ windowTop + ", screenX=" + windowLeft + ", screenY=" + windowTop);
if(newWindow.opener == null) {newWindow.opener =
window};
newWindow.focus();
}
</SCRIPT>
</HEAD>
<BODY><CENTER><A
HREF="javascript:newWindow('#Variables.WindowURL#',
#Variables.WindowWidthIs#, #Variables.WindowHeightIs#);"
TITLE="This pops up a page to add to data displayed in this page. After
you submit your changes the pop up will automatically close and refresh this
page."
onMouseOut="window.status=' ';return(true);"
onMouseOver="window.status='#Variables.WindowURL#';return(true);"
STYLE="text-align: center;"
>add data (#TimeFormat(Now(), 'hh:mm:ss')#)</A></CENTER></BODY>
</HTML></CFOUTPUT>
<!---
Log: /dbabbitt-test/parent.cfm
Revision 1.0 10/14/2001 8:07:05 PM dbabbitt
Basic functionality established.
--->
<CFSETTING ENABLECFOUTPUTONLY="No">
On the child page write something like this:
<CFSETTING ENABLECFOUTPUTONLY="Yes">
<CFSET Local.TemplateID="ID: /dbabbitt-test/child.cfm, v1.0.0 10/14/2001
7:52:12 PM dbabbitt">
<CFOUTPUT><!--
#Local.TemplateID#
-->
</CFOUTPUT>
<!---
Description:
This template displays the contents of the pop up window.
--->
<CFOUTPUT><HTML>
<HEAD>
<META HTTP-EQUIV="Pragma" CONTENT="no_cache">
<CFHEADER NAME="Expires" VALUE="#Now()#">
<CFIF Len(CGI.HTTP_REFERER)><SCRIPT LANGUAGE="JavaScript">
opener.location.reload();
close();
</SCRIPT></CFIF>
</HEAD>
<BODY><CENTER><FORM ACTION="http://#CGI.HTTP_HOST##CGI.SCRIPT_NAME#/"
METHOD="POST" ENABLECAB="No">
<!--- Your form fields go here --->
<INPUT TYPE="submit" VALUE="Press To Reload Parent (#TimeFormat(Now(),
'hh:mm:ss')#)" STYLE="text-align: center;">
</FORM></CENTER></BODY>
</HTML></CFOUTPUT>
<!---
Log: /dbabbitt-test/child.cfm
Revision 1.0 10/14/2001 7:52:12 PM dbabbitt
Basic functionality established.
--->
<CFSETTING ENABLECFOUTPUTONLY="No">
-----Original Message-----
From: Jones, Becky [mailto:[EMAIL PROTECTED]]
Sent: Thursday, October 25, 2001 10:14 AM
To: CF-Talk
Subject: pop up windows
i have a template that i want to be able to have a link that you would click
on that would launch a popup window. the contents of that popup window when
changed will effect the template underneath. my problem is that the window
doesnt automatically close after i click on submit (an alert box asks me if
i really want to close the window) i click on yes, but it doesnt refresh
the template. how can i get the template to automatically refresh with the
new changes and the popup window to just close after the submit button is
clicked? i used window.close() but that still gives me that alert box.
thanks,
bec.
[snip]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists