• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

3. Passing Data Between Templates > 3.2. Passing Data Using Forms

Passing Data Using Forms

Another method for passing data from template to template involves sending the data via the HTTP Post method as form-field data. When you create an HTML form that posts to another ColdFusion template, each form field is automatically available as a form variable within the template specified in the action attribute of the form tag. Within the receiving template, each form field can be referenced by prefixing the field name with form, as in form. MyField. To see just how this works, let’s look at an example. The contactform.cfm template, shown in Example 3-6, creates a simple HTML form that collects basic contact information and posts it to the displaycontactinfo.cfm template, shown in


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint