The Wizard Buttons - Repeating Pages field provides a set of buttons for interacting with repeating pages. There's a full description of the default behaviour in the Repeating Pages - Controls and Navigation article.
The field is aware of the current state of the page it is placed on, and only displays the relevant buttons:
- Add - Hidden when editing or removing an existing page instance, or when the maximum page instances has been reached. Pressing add creates a new instance and navigates to it
- Remove - Only shown on page instances that have already been submitted, hidden when editing or confirming the removal of a page. Pressing remove takes you to the read-only remove mode which displays the confirm button
- Cancel - Shown if the data in a new page instance hasn't yet been submitted and when editing or removing an existing page instance. Pressing it cancels the current action and returns the user to the previous page instance
- Update - Shown when viewing a page instance that has already been submitted. Pressing it loads the instance data into the page fields to be edited
- Confirm - Only shown when removing a page instance. Pressing it removes the instance and navigates back to the previous navigable page instance
Properties
Label | Description | Type Name |
---|---|---|
Button Type | Either "Normal" or "Contrast". Selecting contrast adds the class "btn--contrast", which can then be targeted by the site's style sheet | BUTTONTYPE |
Is iCM Panel Button | If set to true and the form is being used via a Form App shortcut within iCM, the button will be rendered as an action within the Actions Panel. The button itself will be hidden on the form. This allows better integration into iCM when needed | ISICMPANELBUTTON |
Add Label | The label for the add instance button | ADDLABEL |
Add Function | Adds a new page instance and navigates to it | ADDFUNCTION |
Update Label | The label for the update button | UPDATELABEL |
Update Function | Saves the updated page instance data and determines which page should be displayed next. By default, the previous page will be displayed | UPDATEFUNCTION |
Remove Confirmation Label | The label for the button that takes you to the page in remove mode | REMOVECONFIRMLABEL |
Remove Confirmation Function | Displays the current page instance in remove mode | REMOVECONFIRMFUNCTION |
Remove Label | The label for the remove button | REMOVELABEL |
Remove Function | Removes the data for the page instance and determines which page should be displayed next | REMOVEFUNCTION |
Cancel Label | The label for the cancel button | CANCELLABEL |
Cancel Function | Cancels the current action and determines which page should be displayed next. By default, the previous page will be displayed | CANCELFUNCTION |
Override Function | This optional function provides direct control over the buttons displayed by the wizard field type. The function is evaluated server-side when the form HTML is being built. The following actions are available:
| OVERRIDEFUNC |
Additional Styling Modifier | An optional CSS modifier for the field. See Common Field Properties for an example | ADDITIONALSTYLINGMODIFIER |
Documentation | Add documentation to your field to help explain any complex functionality to future users. You might include information on what the field does and how it relates to other fields on the form. Notes added here are only ever visible in the Forms Designer, they can be searched for, viewed and downloaded from the action panel. See Common Field Properties for an example | DOCUMENTATION |
Button Functions
If you write your own button functions, you'll need to be familiar with the following. The Page Modes article has some examples.
Form functions:
Function signatures:
- sessionData - The current session data
- defaultPage - The page that would be navigated to if this function wasn't present. That is:
- Add - The current page
- Update - The page before this instance was loaded
- Remove confirmation - The current page
- Remove - The page before this instance was loaded
- Cancel - The page before this instance was loaded
- defaultPageInstance - The page instance that would be navigated to if this function wasn't present. That is:
- Add - The new page instance
- Update - The instance before this instance was loaded
- Remove confirmation - The current instance in "remove" mode
- Remove - The previous navigable instance. If the final saved instance is being removed, this will be instance 0
- Cancel - The instance before this instance was loaded
Remove Function and Minimum Instances
The default behaviour when removing a page instance is to redirect you back to the page you came from once the instance has been deleted. This will often be the repeating page itself, but a user could navigate back to a repeating page to edit an instance from elsewhere on your form.
For example, if page 1 of your form repeats, and on page 4 of your form you display a "check your answers" summary page that lets a user go back and remove an instance of page 1, once the instance has been deleted, they'll be redirected back to the summary page.
However, if you are validating a minimum number of instances for a repeating page, and removing an instance drops the count of instances below that minimum, removing an instance will reload the repeating page again, until the minimum number of instances have been created.