ColdFusion Losing Data When Browser Re-Fresh

Posted on 2003-03-11
Medium Priority
Last Modified: 2013-12-16
I have server validation on my ColdFusion forms that when you save, it checks to make sure you have valid information in the date and numeric fields. If the data is wrong, then it displays an error message....which is cool. My problem is that when you hit the browser "back" button, all your data is lost. So my users have to re-enter all their data. Is there a way to keep their data, so they only need to correct the invalid field(s)? Maybe at point of saving, somehow send data to a template, then post back after re-fresh?? Thanks in advance. rfranks@adelphia.net
Question by:rfranks

Accepted Solution

CRagsdell earned 100 total points
ID: 8116725
Why is your validation not done client-side?

Yes, you can work around by sending the data to your database, analyze the entries, show error messages and then repopulate the form.

Or just use client-side validation...


Assisted Solution

HamdyHassan earned 100 total points
ID: 8119116
If the validation don't need database, then It's better/faster/easy to do it using javascript at client

Take a look at the following examples

validate date using javascript


Assisted Solution

iredlands earned 100 total points
ID: 8141107
Is your issue the login or the form details not being completed/accurate?

If its the login - set an isDefined() statement on form completion. for info check your docs on cfapplication

If the client uses the back button wrap your form page in an cfif isDefined statement - either pulling db info to poulate the fields or set cflocation to take them to another page

If the form details not completed or accurate is the issue - 2 solutions 1) validate via javascript the details are correct client side or 2) validate on next cfm page if not accurate pass back to form page - variables will still be active, populate your fields

Hope this helps
LVL 53

Expert Comment

ID: 9115231
This question has been classified abandoned. I will make a recommendation to the
moderators on its resolution in a week or two. I appreciate any comments
that would help me to make a recommendation.

Unless it is clear to me that the question has been answered I will recommend delete.  It is possible that a Grade less than A will be given if no expert makes a case for an A grade. It is assumed that any participant not responding to this request is no longer interested in its final disposition.

If the user does not know how to close the question, the options are here:



Expert Comment

ID: 9647937
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Split between CRagsdell, HamdyHassan, iredlands

Please leave any comments here within the next seven days.


EE Cleanup Volunteer

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
The purpose of this video is to demonstrate how to set up an RSS Feed on a WordPress Website. This will be demonstrated using a Windows 8 PC. Feedburner will be used for this demonstration. Go to your WordPress login page. This will look like the…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

624 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question