Using Client Variables

Client variables are ideal for storing things like user preferences, recent form entries, and other types of values that you don’t want to force your users to provide over and over again.

Remembering Values for Next Time

Consider a typical search form, in which the user types what they are looking for and then submits the form to see the search results. It might be nice if the form could remember what the user’s last search was.

The code in Listing 20.6 lets it do just that. The basic idea is that the form’s search criteria field will already be filled in, using the value of a variable called SearchPreFill. The value of this variable is set at the top of the page and will be set to the last search the user ran, if available. ...

Get Adobe ColdFusion 8 Web Application Construction Kit, Volume 1: Getting Started now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.