The following example shows how to create a form that appears on multiple pages. This is example uses the same form as in Example: Creating a job application form except that its steps appear on separate pages. It uses the following elements: Form step, Text, Selection, Text area, Hidden visitor profiling, Hidden predefined value, File Upload, and Submit button.
You can watch the following demonstration video, Creating a multi-step form. (5:40 minutes)
- Create 3 new pages: Page A, Page B, and Page C.
- From the Assets pane, select Forms to list the existing form folders.
- From a folder's context menu, select New Form and give it a name such as Job application 2.
- Drag form elements onto the new form. The following image shows edited elements for the Job Application form.
- Form Step. Rename to Step 1.
- Text. Rename to Full name with Required.
- Text. Rename to Email with Tooltip.
- Label. Select your job application choice.
- Required. Enabled.
- Choices. Use manual input.
- Add items
- Choice: Development ; Value Development .
- Choice: Engineering; Value Engineering.
- Choice: Expert Services; Value Expert Services.
- Choice: Support; Value Support.
- Form Step.
- Rename to Step 2.
- On Settings tab:
- Display Step in other content. Click Browse and select Page B.
- Only display if field: Click browse [...] and select Job Type.
- value.... Select Equals.
- the following value. Enter Support.
- Text area. Rename to Cover Letter.
- Form Step.
- Rename to Step 3.
- On Settings tab > Display Step in other content. Click Browse and select Page C.
- Hidden visitor profiling. Select Geo: Region code.
- File Upload.
- Label text. Rename to Upload Resume.
- Max file size. 4 (MB).
- Allowed extensions: pdf, docx, txt
- Submit button. Rename to Submit Resume.
- Select All Properties and enable Show Navigation bar if the form has multiple steps.
- Place the Job Application 2 block on Page A, Page B, and Page C and publish the pages.
Test your form
To test your form, go to Page A and add the Job application 2 form. Go to the website (View on website) and enter data into the form on the page in View mode.
- Enter a name, email address, select an option and click Next Step.
- If you choose Support, then you see the following step on Page B. If you do not select Support, then you see the next step on Page C. Enter text for a cover letter and click Next Step.
- Click Choose File and upload a file (pdf, docx, or txt only). Then click Submit resume. When you submit the data, it is stored in the Episerver Dynamic Data Store (DDSDynamic Data Store; a component offering an API and infrastructure for the saving, loading and searching of compile-time data types (.NET object instances) and runtime data types (property bags). The component is shipped as part of the Episerver Framework package.) .
View form submissions
To view the results of your test, go to your Job Application 2 form block and select Form submissions from the context menu. The Form submissions view appears with data submitted from the form.
You can export form data to XML, CSV, or JSON formats.
The following example shows how to use the Rich text field to add a confirmation step to the Example: Creating a multi-page job application form.
- Edit the Job Application form, and add a Form step and a Rich text element before Step 2.
- Edit Form Step and publish the element,
- Rename to Confirm entries and add a Description.
- On the Settings tab > Display Step in other content. Click Browse and select Page A.
- Edit Rich text as shown in the following image, and publish the element. Use the Insert placeholder drop-down to add placeholders to the content.
- Go to your page where the multiple-step form is and enter information, similar to that shown in the following image.
- Click Next step. The confirmation step appears with the previously entered data.