<form_structure> creates a data structure which describes an entire form specification, including each field of the form, and data for that field. Process:
- Set up TOP-LEVEL Cold Fusion STRUCTURE FOR FORM (may be influenced by certain attributes or incoming form fields.)
- Set up FORM FIELD SPECIFICATION (describes each field on form, including help text.)
- Load FORM DATA. Loop through form's records, and enter incoming data from database or from incomming form fields.
<form_data> adds data for that form structure's group or page_type & record combination. Process:
- Loop through form's field specification records, and enter any incoming incomming form field data or data from database.
<form_validate> does:
- VALIDATE form's data by examining each field against the field's type's validation proceedure. Valid status of individual fields, as well as entire form, is updated.
<form_process>
- If appropriate, process any incoming record into database or file log, and/or email form contents (it applies <form_email> tag). This includes the ability to carry out nonstandard postprocessing of the form's data via the pre-process and post-process templates, if any, given in the form specification.
<form> can be used following any of the above tags!
- Display form in create, edit or view mode.
For example, use it right after <FORM_STRUCTURE> (with mode=create_form) to display a form for creating a new record (novalidation or form processing tags are necessary in this case). Or use it and specify "mode=view", after <FORM_PROCESS> to show a web user his/her processed form's contents.
<form_email>
- If the form is linked as a parent to one or more email templates, form contents will be sent via those email templates to designated recipients. Since the <form_process tag includes the <form_email> check, there is no need to apply both tags.
SECURITY
NOTE: A user's right to create, update, or view a content record is a separate matter from a user's right to create, update or view a given form. Having rights to use a form doesn't necessarily mean rights are given to view anything the form can handle. The first "question" a form asks is whether a given user has the right to view or update the content that the form has been requested to handle.
ASSUMPTIONS
Only one form's data is coming in and being processed at a time. If a request is handled with the creation of more than one <form_structure...> call, one cannot distinguish whether the cold fusion environment's form.[form field] variables pertain to the first, second or n'th form.
If you run into this problem, here is a temporary workaround: between generation of <form_structure>, use cold fusion's structclear(form). This clears out all form variables. Then reestablish those form variables you need (if any) for later instances of call. Note: Cold Fusion's own form.fieldnames variable may need to be cleared too, in the case where subsequent forms are drawn in create_form or update_form mode and therefore are looking to the form.X environment for possible incomming form or URL parameter defaults.
<- ->
|