Required fields, validation and containers
Summary This lesson is for people who build forms in the SD Form Builder, and it also shows what people filling in the forms see. It covers making a field required, writing the message shown when it…
Check yourself
Checking your PaT sign-in…
How To
On this page
- Making a field required
- Step 1
- Step 2
- Step 3
- Step 4
- Step 5
- Step 6
- Step 7
- Checking an answer with a validation rule
- Step 1
- Step 2
- Step 3
- Step 4
- Step 5
- Step 6
- Step 7
- Step 8
- Step 9
- Step 10
- Step 11
- Starting a field group open or closed
- Step 1
- Step 2
- Step 3
- Step 4
- Step 5
- Step 6
- Step 7
- Step 8
- How a field group shows its required fields
- Step 1
- Step 2
- Step 3
- Step 4
- Adding a progress badge to a field group
- Step 1
- Step 2
- Step 3
- Step 4
- Step 5
- Step 6
- Step 7
- Step 8
- Step 9
- Step 10
- Listing unfinished field groups when someone submits
- Step 1
- Step 2
- Step 3
- Step 4
- Step 5
- Step 6
- Step 7
- Step 8
- When someone submits with a required answer missing
- Step 1
- Step 2
- Step 3
- Required fields that are hidden
- Step 1
- Step 2
- Step 3
- Step 4
- Step 5
- Step 6
- Purpose / Intent of the Module
- Header One
Summary This lesson is for people who build forms in the SD Form Builder, and it also shows what people filling in the forms see. It covers making a field required, writing the message shown when it is left empty, and adding a validation rule that checks the answer. It also covers field groups, the Field Group element under the Container control: starting them open or closed, how they show which required fields are still empty, and how they open by themselves when someone submits with an answer missing.
Making a field required
Step 1
In the SD Form Builder, find the field on the Canvas and click its edit button (the pencil), in the row of small buttons at its top right. The Edit form field window opens.
Step 2
Click the Required and Validation tab, along the top of the window.
Step 3
Switch Required Control to YES. On the form, the field's title then shows a red star (*), so people know they must answer it.
Step 4
Once Required Control is set to YES, a Custom Validation Text box appears beside it. Type the message people see if they leave the field empty, for example Please enter a phone number we can call.
Step 5
If you leave Custom Validation Text empty, PaT shows its own message instead, such as This field is required.
Step 6
Click the green Save and Close button at the bottom right of the window. Its name ends with the type of field, for example Save and Close Multi Select Boxes.
Step 7
Save and Close also saves the form. If the Canvas heading then shows (Unsaved changes) in red, click Save Form Now, at its right, to save the form.
Checking an answer with a validation rule
Step 1
A validation rule checks what people type, such as an email address or a number in a range. On the Canvas, click the field's edit button (the pencil), at its top right.
Step 2
In the Edit form field window, click the Required and Validation tab.
Step 3
Switch Add form Response Validation to YES. A Response Validation section opens below it.
Step 4
In Validation Type, choose Text, Number, Regex or Length. The boxes for that type then appear in the section.
Step 5
In Validation Rule, choose the check. For Text, the rules are email, url, Contains and Doesn't contain. For Length, they are Maximum character count and Minimum character count.
Step 6
For Number, the rules are Greater than, Greater than or equal to, Less than, Less than or equal to, Equal to, Not equal to, Between, Not between, Is number and Whole Number. For Regex, they are Contains, Doesn't contain, Matches and Doesn't match.
Step 7
Fill in the box the rule needs: Text for Contains, Value for a number or a character count, Min number and Max number for Between, or Pattern for a Regex rule.
Step 8
When an answer breaks the rule, the form cannot be submitted, and PaT's own message shows in red under the field, such as Must be a valid email or Must be a whole number.
Step 9
A validation rule can make a field required even when Required Control is NO. With an email rule, for example, an empty answer is refused and the form cannot be submitted. The message is the field's title followed by is a required Field, and the field shows no red star.
Step 10
To use your own words, type them in Custom Error Message, at the bottom of the Response Validation section. Your words replace PaT's own message for the rule.
Step 11
Click Save and Close at the bottom right of the window. It also saves the form.
Starting a field group open or closed
Step 1
A field group is the Field Group element, under the Container control of the form builder. With its default Display Style, Accordion, people open and close the group by clicking its title bar. The other two Display Styles are Container and Group (no card). A Group (no card) has no title, card, padding or badge: people see only the fields inside it.
Step 2
On the Canvas, click the field group's edit button (the pencil), at its top right. The Edit form field Field Group window opens.
Step 3
On its General tab, find the switch Field Group State will be Expanded when initialised.
Step 4
Leave it at YES, the default, for the group to be open when the form opens. Set it to NO for the group to start closed, showing only its title bar.
Step 5
The switch is for groups whose Display Style, also on the General tab, is Accordion. A group saved with Display Style Container has no such switch: it cannot be closed, so it is always open.
Step 6
Click Save and Close Field Group at the bottom right of the window. It also saves the form.
Step 7
While you build, the Canvas shows every field group open. To see how a group starts, click Preview, the green button at the top left of the form builder.
Step 8
People filling in the form click a group's title bar to open or close it. The arrow at the right end of the bar points down while the group is closed, and up while it is open.
How a field group shows its required fields
Step 1
When a field group holds required fields, a thin coloured strip runs down the left edge of its title bar. It shows on groups with the Accordion display style, with nothing to switch on.
Step 2
The strip is orange while at least one required field in the group is still empty.
Step 3
It turns green once every required field in the group is filled in. The title bar then becomes slimmer and paler, so the answers below it stand out.
Step 4
The strip is worked out again each time an answer in the group changes, so it changes as people type, with no need to click Submit. If someone empties a required field again, the strip turns back to orange.
Adding a progress badge to a field group
Step 1
A field group can also show a progress badge for its required fields, whether its Display Style is Accordion or Container. On the Canvas, click the field group's edit button (the pencil), at its top right.
Step 2
In the Edit form field Field Group window, click the Required and Validation tab.
Step 3
Switch Show Validation Badge to YES. It is NO by default, so groups show no badge until you switch it on.
Step 4
Click Save and Close Field Group at the bottom right of the window. It also saves the form.
Step 5
On the form, the badge sits at the right of the group's title bar, beside the arrow, when the group holds required fields. It shows how many are done, such as 2 of 5 completed, and how many are left, such as 3 PENDING.
Step 6
On a group whose Display Style is Container, the badge sits at the right of the group's title. If Hide Title, on the group's General tab, is YES, the group shows neither its title nor its badge.
Step 7
Point at the pending count to see a list headed REQUIRED FIELDS PENDING, with the names of up to 5 empty required fields. If more are empty, the list ends with how many more.
Step 8
The badge, like the strip, changes as people type. Once every required field in an Accordion group is filled in, the badge goes away and the strip turns green.
Step 9
On a phone, the badge is a small round count of the required fields still empty.
Step 10
The badge shows on the form and in Preview, but not on the Canvas while you build.
Listing unfinished field groups when someone submits
Step 1
A form can also list the field groups that still have required fields empty when someone submits it. In the form builder, click Settings, in the bar along the top, towards its right end.
Step 2
In the Settings window, switch Show FieldGroup Validation Toast to YES. It is off by default.
Step 3
Click Save at the bottom of the Settings window.
Step 4
If the Canvas heading then shows (Unsaved changes) in red, click Save Form Now, at its right, to save the form.
Step 5
Now, when someone submits the form with required fields empty in a field group, a box titled Incomplete Required Fields opens at the bottom of the screen. The red number beside the title is how many groups are unfinished.
Step 6
The box lists each unfinished group by its title, with how many required fields are pending, such as 2 of 4 required fields pending, and the names of up to 3 of them. A group that was closed is marked Collapsed.
Step 7
Click a group in the list to go straight to it. If the group is closed, it opens.
Step 8
To close the box, click the X at its top right. It also closes by itself after 15 seconds.
When someone submits with a required answer missing
Step 1
When someone submits a form with a required field empty, the form is not sent. The field's message shows in red under it.
Step 2
If the empty field is inside a closed field group, the group opens by itself, so the person can see what is missing.
Step 3
The page then scrolls to the first field group, or the first field, that still needs an answer.
Required fields that are hidden
Step 1
A required field that is hidden does not stop the form being sent. A closed field group is not hidden: its required fields still count.
Step 2
A field can have a show or hide rule, set with Conditionally show or hide field on its Conditional Logic tab. The lesson Conditional Formatting shows how to set one up.
Step 3
While its rule hides the field, the form can be sent without it, even though Required Control is YES. Once the rule shows the field, it must be answered.
Step 4
The same goes for a field group with a show or hide rule. While the group is hidden, none of the required fields inside it, at any depth, stop the form being sent.
Step 5
A field or field group with Hide Control set to YES, on its General tab, never shows on the form, so its required fields never stop the form being sent.
Step 6
Hidden required fields are also left out of a field group's strip and badge, and out of the list of unfinished groups.
Purpose / Intent of the Module
A brief description of what this module is about
Header One
Rate this page
Checking your PaT sign-in…