Home
Username:
Password:
Adobe ColdFusion 8 Tutorials

ColdFusion Form Features / Preserving Form Data




Visitors to VTC.com will be able to view all introductory videos for each training course.
Free Trial Members will gain access to first three chapters for each training course.
Full Access Members have full access to VTC.com’s entire library of video tutorials.


Learn More

Subtitles of the Movie

What I want to show you now is a feature in ColdFusion that allows you to preserve form data and I actually have a form down at the bottom here. I tend to find quite a few browsers do this automatically now and so it's a little more difficult for me to demonstrate for you. But, I have a form down here. This is a copy of the Suggest a Tour page and form and there are two fields, these two fields are not populated correctly, so just ignore Preferred Diving and Countries. Those are not populated from our database at this point in time. But the idea behind this is there is a Preserve Data attribute for the CFFORM tag, and what that does is make sure that once the user has submitted the data, if they go back to the page by hitting the Back button, it will show their items in the browser. Now, as I said, most browsers tend to do this automatically so it's getting harder and harder for me to demonstrate this in class. You may want to use your browsers because if I go and populate these form fields and I click Contact SUMA to get to the next page, if I hit the Back button you can see I still have information inside of here even though I don't have this. That is the browser doing it. But let me go ahead and show you, because I tend to like to do this on my forms and there's one little glitch if you do this. So I'm going to go inside the CFFORM tag and say: preserve data equals yes. And that makes sure that if it's not set up in the browser that the data is preserved. Now that is a great feature but it is for the entire form. If you have a form field that you do not want to preserve the data you would just not make that particular form field a ColdFusion form field, just make it a basic html form field. Things such as passwords, or security issues, you may not want to have showing up in the browser. If it's a password it's just going to show as asterisks but it still might become an issue. So if you need to do that, what I would do if this was the form field I didn't want, I would need to convert this to an HTML form field and do some other type of validation besides this ColdFusion form validation I have set up right here. So, just a suggestion on that one. But, that is the preserve data equals yes attribute to make sure if the user, if they click the Back button after submitting, that their form field and form information is still showing up in the browser. So that is Preserve Form Data in the ColdFusion Form tag.

Tutorial Information

Course: Adobe ColdFusion 8
Author: Candyce Mairs
SKU: 34093
ISBN: 1-936334-05-4
Release Date: 2010-02-26
Duration: 8 hrs / 112 lessons
Work Files: Yes
Captions: Available on CD and Online University
Compatibility: Vista/XP/2000, OS X, Linux
QuickTime 7, Flash 8

VTC Sign up & Benefits

  • Unlimited Access
  • 98,729 Video Tutorials (23,265 free)
  • Video Available as Flash or QuickTime
  • Over 1026 Courses
  • $30 for One Month Access
  • Multi-User Discounts Available