WebForms implementation overview
This section provides an overview of how to create, customize and publish Forms and how to use behaviors to regulate how visitors interacts with a Form.
The following diagram shows the WebForms architecture:
Creating, customizing and publishing Forms
Create, customize, and publish a Form as follows:
- Creating WebForms
- Authors and editors use the WebForms Designer to create and edit Forms. A Form is based on a WebForm Schema that defines the XML form elements, form pages, and Field Types of the Form. A Form consists of a number of Form Pages that represent the steps in the Form. Each Page contain Fields based on predefined or custom Field Types. Each field has predefined Field properties to which you can add values to, such as a label or a line length. You can add fields to a form by dragging and dropping predefined Field Types into the form.
- Creating custom Field Types
-
WebForms comes with predefined Field Types. Using the WebForms Field Type Editor, implementers can create custom Field Types for form authors to use. using a combination of the following items:
- Field Type Schemas—define the properties of a Field Type
- Field Type XSLTs—define how the fields are processed and rendered
- Publishing Forms
-
When Form authors publish Forms to the Web site, where visitors fill them in and submit them. Publishing a Web page with a Form involves:
- selecting a WebForms XSLT Component Template for the Form, which contains XSLT to expand and render the Form
- placing the Form Component and its Component Template as a Component Presentation on a Page with a properly configured Page Template
- applying CSS style sheets to the Form
- keeping track of the visitor’s session of the Form
Applying Behaviors
WebForms uses Behaviors to regulate and restrict the way a visitor interacts with a form, the types of values that a visitor enters into a form, and the way in which the form is submitted to your back office system (the business logic of the Form).
For example, when a Web site visitor fills in and submits a Form WebForms can:
- prefill fields with calculated values (for example, today’s date).
- validate fields that the visitor entered (for example, it can disallow text in a number field).
- show or hide fields or whole parts of the Form based on what the visitor entered somewhere else in the form For example, it may show a screen to enter personal data only if the visitor indicates he or she did not yet register.
Behaviors use Field Type properties and reusable pieces of code called Business Rules. When you configure Behaviors, you can use predefined Business Rules or create custom Business Rules.
- Relevant Behavior
- This Behavior determines if a specific Field, or a whole Form Page, is shown to the visitor or not, depending on the values of (other) Fields. For example, the Relevant Behavior may specify that the Form Page to specify a billing address is not shown if the user ticked a check box 'Billing address is the same as the shipping address".
- Prepare Behavior
- This Behavior can calculate an initial value for a field (rather than a hard-coded default value or no default value). For example, this Behavior could set a Date field to the initial value of today's date.
- Validate Behavior
- This Behavior determines whether the value that the visitor provides for a field is valid. The existing Field Types apply basic predefined Business Rules that prohibit, say, text being entered in a number field. You can also apply some predefined Business Rules to further restrict the possible values for a field (for example, you can apply the Business Rules that enforces that the text in a text field is a valid e-mail address). And finally, you can create your own custom Business Rules to validate fields of existing Field Types in a new way, or to validate custom Field Types that you developed yourself.
- Export Behavior
- This Behavior executes when the user submits a completed Form with valid Fields. Business Rules ensure that some or all of the fields are exported to a back office.