You will have problems with this method in NN.

What I have done in the past is the same code, but throwing into a function
and having the onload event trigger it.

EXAMPLE:

<cfsetting enablecfoutputonly="yes">

<cfif>
..
<cfelse>

        <cfoutput>
        <html>
        <head>
        <title>Redirecting, Please Wait</title>
        <script language="JavaScript" type="text/javascript">
        <!--
        function goBack(){
                var msg = "The file was too large, please select another
file.";
                history.go(-1);
        }
        //-->
        </script>
        </head>
        <body onload="goBack();">
        <body>
        </html>
        </cfoutput>

</cfif>

<cfsetting enablecfoutputonly="no">

Hope this helps!
-- 
SCOTT VAN VLIET 
SENIOR ANALYST 
SBC SERVICES, INC 
Tel: 858.886.3878 
Fax: 858.653.6763 
Email: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> 




-----Original Message-----
From: Joel Firestone [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 20, 2002 8:18 AM
To: CF-Talk
Subject: Re: JS back?


How about:

.
<cfelse>
    <script language="JavaScript">
    alert("Your file is too big!");
    history.back();
    </script>
    <cfabort>
</cfif>

HTH

Joel

----- Original Message -----
From: "Greg" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Wednesday, March 20, 2002 11:06 AM
Subject: JS back?


> I'm testing for file size after posting a form. Is there a way to use
> javascript:history.back() to send me back to the form instead of having
> to pass all the form values back in the url of cflocation? (Also don't
> want to do the wddx thing because I have to use
> enctype="multipart/formdata" to submit the input type="file", and the
> only way I know to serialize the form data is to loop over the
> form.fieldnames and it in a structure. And with
> enctype="multipart/form-data" form.fieldnames plays out as the VALUES
> instead of the actual fieldnames.) I tried this:
> <cfif cgi.content_length LTE 10000><!---set for files 50k or less --->
> <cffile ACTION="Upload"
> FILEFIELD="photo"
>
> DESTINATION="D:/wserver/ediets/myediets/profile/photos/#form.username#"
> NAMECONFLICT="OVERWRITE"
> ACCEPT="image/gif, image/jpg, image/jpeg,
> image/pjpeg">
> <cfelse>
> <cfset message="Your file is too big!">
> <body onload="javascript:history.back()"></body>
> </cfif>
> But it's sloppy. Any javascripters know if I could have an alert box to
> display the message. Then after you click OK it could do the
> javascript:history.back()?
>
> 

______________________________________________________________________
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/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to