Creating Action Pages

Note To create an action page for the form:
  1. Create a new application page in HomeSite.
  2. Save the page as ActionPage.cfm within the CFDOCS directory.
  3. Remember that the form that you just created will pass values to a page called ActionPage.cfm when the form is submitted.

  4. Title the page Chapter 7 Action Page.
  5. Add a heading for the action page output:
  6. <H4>Employee Data Passed to the Action Page </H4> 
  7. Add a CFOUTPUT block after the heading:
  9. Label and define form variables within the CFOUTPUT block to return them back to the user:
  10. Last Name: #Form.LastName#<BR>
    Department: #Form.Department_Name#<BR>
    Contract Employee? #Form.Contract#<BR>
  11. Save the page.
  12. View FormPage.cfm in your browser.
  13. Enter data for each form control and submit it.
  14. ActionPage.cfm should return the values that you submitted.

    If you receive errors, read the message and check for spelling mistakes.

  15. Return to the form in your browser.
  16. Reset the values.
  17. Do not check the checkbox and submit the form again.
  18. An error occurs when the checkbox does not pass to the action page.

    During the next chapter, you will learn how to use conditional logic to handle this form limitation.

Click here to run the form and see how the action page should look at this time.

Click here to see the code behind the scenes.

Note Note:Remember that, if you submit the form without checking the checkbox, you will receive errors. You will learn how to apply conditional logic to your action page to compensate for this HTML limitation in the next chapter.