close the window in JS anymore. You could do one of the following, but
neither are perfect and you may have problems with security settings in
the browser.
function openAttachment(){
window.open("<cfoutput>#cgi.SCRIPT_NAME#?FILENAME=#url.FILENAME#&ID=#url
.id#&promptUser=false</cfoutput>",'Download','top=10,left=10,height=0,wi
dth=0,resizable=1,scrollbars=0');
window.close();
}
function openAttachment(){
opener.location =
"<cfoutput>#cgi.SCRIPT_NAME#?FILENAME=#url.FILENAME#&ID=#url.id#&promptU
ser=false</cfoutput>";
window.close();
}
Pascal
> -----Original Message-----
> From: cf coder [mailto:[EMAIL PROTECTED]
> Sent: 28 September 2004 14:03
> To: CF-Talk
> Subject: How do I close the pop-up window - kindly help
>
> Hi Guys, I'm hoping someone can help me. I've tried everything but
can't
> quiet nail this problem. I have this page that has a hyper-link.
Clicking
> on the hyper-link opens up a pop-up window. The url looks something
> like this:
>
>
window.open('attachment.cfm?promptUser=true&id=12345&filename=testfile',
> 'Attachment',
> 'top=10,left=10,height=315,width=600,resizable=Yes,scrollbars=Yes');
>
> You may have noticed I'm passing a url variable 'promptUser' with a
> default value of 'true'.
>
> Here is the code in the pop-up window.
>
> <script language="_javascript_">
> function openAttachment(){
> window.location =
>
"<cfoutput>#cgi.SCRIPT_NAME#?FILENAME=#url.FILENAME#&ID=#url.id#&promptU
se
> r=false</cfoutput>";
> }
>
> function cancelAttachment(){
> window.close();
> }
> </script>
>
> <!--- if the url variable promptUser is true, display few instructions
to
> help
> the user to decide what he must be doing --->
> <cfif isDefined("url.promptUser") and promptUser eq "true">
>
> <table width="100%" border="0" cellspacing="0" cellpadding="5">
> <tr>
> <td>
> If you intend to modify an existing attachment, you must
> follow the below steps:
> <br>
> blah blah blah
> </td>
> </tr>
> <tr>
> <td valign="top" align="center">
> <img src="" id="okbutt" name="okbutt"
> border="0" alt="open attachment" > > <br>
> </td>
> <td valign="top" align="center">
> <img src="" id="cancelbutt"
> name="cancelbutt" border="0" alt="close" > > <br>
> </td>
> </tr>
> </table>
> <!--- if it is false, just open the attachment in its own application
--->
> <cfelseif url.promptUser eq "false">
>
> <cfset fName = url.filename>
> <!--- Generates custom HTTP response headers to return to the
> client. --->
> <CFHEADER NAME="Content-Type" VALUE="application/unknown">
> <CFHEADER NAME="Content-Disposition" VALUE="attachment;
> filename=#fName#">
> <CFCONTENT TYPE="application/unknown"
FILE="UploadFolder\#fName#"
> deletefile="no">
>
> </cfif>
>
> I hope the above code is self-explainatory. If you notice, I'm setting
> 'promptUser' url variable to 'false' in the 'openAttachment' function.
> This opens up the file open/save dialog box.
>
> Now then, this is where I'm stuck. I want to close the pop-up window
when
> the 'promptUser' value is 'false', in other words when the user clicks
on
> the 'okbutt' button. Can someone show me how to do this.
>
> I would really appreciate your help
> Best regards,
> cfcoder
>
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

