You're right, the cflocation would execute before the page is sent to the
browser - so the javascript wouldn't get executed.
It sounds to me like your root cause is page caching (or more specifically
in your case, a lack of page caching). We ran into that "Data Missing"
condition a bunch of times. The best solution we have found is to use
javascript validation of data, on the submission page (i.e. where the form
is), OR, if you can do it - use form GET methods instead of POST. (not
applicable in all cases).
HTH
Shawn Grover
-----Original Message-----
From: Garry Red 5 [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 18, 2001 7:58 PM
To: CF-Talk
Subject: cflocation/javascript
This is a multi-part message in MIME format.
------=_NextPart_000_0013_01C14102.4BF2FC00
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Hi
We have a problem involving cflocation. In our code we have a user-intensive
form, and when this is processed various (complicated) checks are performed
to ensure data validity. If the numbers entered do not meet certain
conditions, the page uses cflocation to redirect to a standard error page.
However we have received emails suggesting that sometimes when this happens,
and the user pressed back on their browser, their inputted data is lost and
they have to enter it all again.
We hoped to fix it with the following code, which we hoped would open a
smaller window with the error message, while leaving the main window with
data intact for easy modication:
var popupfeatures =
"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,r
esizable=yes,width=530,height=350";
function showWindow(myurl)
{
var win = open(myurl,'popupwindow',popupfeatures);
win.focus();
}
<cflocation url="javascript:showWindow('xxx')" addtoken="no">
But while this works on my machine, it does not run on my colleague's. He is
using Win2000 whereas I am using NT. Maybe it has something to do with the
javascript running on the client while the cflocation is resolved on the
server (Just a guess. I have no idea.)
So my question is how can I achieve this. I've tried various other things
which open a popup window but continues processing the main window, losing
the entered data display. Any advice would help.
By the way, I know you might suggest that I look into why the page is not
remembering the data on the back button, or that I simply repost back to the
form displaying the error message and data, but believe me, in the context
of this code, this is very very complicated.
Thanks
Garry
------=_NextPart_000_0013_01C14102.4BF2FC00
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2314.1000" name=3DGENERATOR></HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D483003701-19092001>Hi</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D483003701-19092001></SPAN></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D483003701-19092001>We =
have a problem=20
involving cflocation. In our code we have a user-intensive form, and =
when this=20
is processed various (complicated) checks are performed to ensure data =
validity.=20
If the numbers entered do not meet certain conditions, the page uses =
cflocation=20
to redirect to a standard error page. However we have received emails =
suggesting=20
that sometimes when this happens, and the user pressed back on their =
browser,=20
their inputted data is lost and they have to enter it all=20
again.</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D483003701-19092001></SPAN></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D483003701-19092001>We =
hoped to fix it=20
with the following code, which we hoped would open a smaller window with =
the=20
error message, while leaving the main window with data intact for easy=20
modication:</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D483003701-19092001></SPAN></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2><SPAN =
class=3D483003701-19092001> =20
var popupfeatures =3D=20
"toolbar=3Dno,location=3Dno,directories=3Dno,status=3Dno,menubar=3Dno,scr=
ollbars=3Dyes,resizable=3Dyes,width=3D530,height=3D350";<BR> &=
nbsp;=20
function showWindow(myurl) <BR> =20
{<BR> var win =3D=20
open(myurl,'popupwindow',popupfeatures);<BR>  =
;win.focus();<BR> =20
}</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D483003701-19092001></SPAN></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2><SPAN =
class=3D483003701-19092001> =20
<cflocation url=3D"javascript:showWindow('xxx')" addtoken=3D"no">=20
</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D483003701-19092001></SPAN></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D483003701-19092001>But =
while this works=20
on my machine, it does not run on my colleague's. He is using Win2000 =
whereas I=20
am using NT. Maybe it has something to do with the javascript running on =
the=20
client while the cflocation is resolved on the server (Just a guess. I =
have no=20
idea.)</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D483003701-19092001></SPAN></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D483003701-19092001>So my =
question is=20
how can I achieve this. I've tried various other things which open a =
popup=20
window but continues processing the main window, losing the entered data =
display. Any advice would help.</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D483003701-19092001></SPAN></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D483003701-19092001>By the =
way, I know=20
you might suggest that I look into why the page is not remembering the =
data on=20
the back button, or that I simply repost back to the form displaying the =
error=20
message and data, but believe me, in the context of this code, this is =
very very=20
complicated.</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D483003701-19092001></SPAN></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D483003701-19092001>Thanks</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D483003701-19092001></SPAN></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D483003701-19092001>Garry</SPAN></FONT></DIV></BODY></HTML>
------=_NextPart_000_0013_01C14102.4BF2FC00--
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
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