Another approach is to point the form submission back to the original form
- where the processing is done at the top and if the submission SUCCEEDS
you can cflocate somewhere else. If it fails for whatever reason, the form
is presented again, with non-conforming values removed, but the remaining
fields have their data intact (<INPUT TYPE="text" NAME="field"
VALUE="#value">). This is similar to the way you would use the same form
template for adding and editing a record...

Then you don't have to relay on browser issues at all AND the feedback to
the user is immediate and obvious. Especially when you can highlight the
errors...

> 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>&nbsp;</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>&nbsp;</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>&nbsp;</DIV>
> <DIV><FONT face=3DArial size=3D2><SPAN =
> class=3D483003701-19092001>&nbsp;&nbsp;&nbsp;=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;&nbsp;&=
> nbsp;=20
> function showWindow(myurl)&nbsp;<BR>&nbsp;&nbsp;&nbsp;=20
> {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var win =3D=20
> open(myurl,'popupwindow',popupfeatures);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
> ;win.focus();<BR>&nbsp;&nbsp;&nbsp;=20
> }</SPAN></FONT></DIV>
> <DIV><FONT face=3DArial size=3D2><SPAN=20
> class=3D483003701-19092001></SPAN></FONT>&nbsp;</DIV>
> <DIV><FONT face=3DArial size=3D2><SPAN =
> class=3D483003701-19092001>&nbsp;&nbsp;&nbsp;=20
> &lt;cflocation url=3D"javascript:showWindow('xxx')" addtoken=3D"no"&gt;=20
> </SPAN></FONT></DIV>
> <DIV><FONT face=3DArial size=3D2><SPAN=20
> class=3D483003701-19092001></SPAN></FONT>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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]/
> Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
>


Tony Schreiber, Senior Partner                  Man and Machine, Limited
mailto:[EMAIL PROTECTED]                   http://www.technocraft.com

http://www.simplemessageboard.com ___Free Forum Software for Cold Fusion
http://www.is300.net ___________The Enthusiast's Home of the Lexus IS300
http://www.digitacamera.com ______________DigitA Camera Scripts and Tips
http://www.linklabexchange.com _____________Miata Link ECU Data Exchange
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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

Reply via email to