Perhaps you should re-think the entire process going on here.
With form validation, and invalid information is entered, I usually give
an error message at the top of the page, and then show the form populated
with the information that they have entered. If you really want to be
fancy, then highlight the field in error on the form.
If it passes validation, then you can use cflocation after the insert or
update of the data, which can be good because then they can't refresh and
insert 5 records in a row on accident.
>From a technical and usability perspective, I think that making someone go
to a page just to tell them to go to another page is a headache for all
involved.
- my $.02
Ben Morris
>>> "Garry Red 5" <[EMAIL PROTECTED]> 09/18/01 09:57PM >>>
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-intensiv
e
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,scrol
lbars=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=20involving cflocation. In our code we have a user-intensive form, and=
when this=20is processed various (complicated) checks are performed to ensure data=
validity.=20If the numbers entered do not meet certain conditions, the page uses=
cflocation=20to redirect to a standard error page. However we have received emails=
suggesting=20that 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,menuba=3Dno,sc=
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=20on 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=20client 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=20how 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=20you 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=20message 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]/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Your ad could be here. Monies from ads go to support these lists and provide more
resources for the community. http://www.fusionauthority.com/ads.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