Adobe ColdFusion 8 Web Application Construction Kit, Volume 1: Getting Started
by Ben Forta, Raymond Camden, Charlie Arehart
Reusing Forms
You can now add to as well as update and delete from your Films table. But what if you need to change the form? What if you needed to add a field, or change validation, or update colors? Any changes that need to be made to the Add form also must be made to the Update form.
With all the effort you have gone to in the past few chapters to prevent any duplication of effort, this seems counterproductive.
Indeed it is.
The big difference between an Add and an Update form is whether the fields are prefilled to show current values. Using ColdFusion conditional expressions, you can create a single form that can be used for both adding and updating data.
To do this, all you need is a way to conditionally include the value attribute in
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access