You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/form/README.md
+141-2Lines changed: 141 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,7 +33,7 @@ form.resetValidation();
33
33
```html
34
34
<tp-formprevent-submit="yes">
35
35
<formaction="#">
36
-
<tp-form-fieldrequired="yes"revalidate-on-change="no"> <--Ifyoudon't want to revalidate as the value changes
36
+
<tp-form-fieldrequired="yes"revalidate-on-change="no"> <!-- If you don't want to revalidate as the value changes-->
37
37
<label>Field 1</label>
38
38
<inputtype="text"name="field_1">
39
39
</tp-form-field>
@@ -55,7 +55,7 @@ form.resetValidation();
55
55
<textareaname="field_4"></textarea>
56
56
</tp-form-field>
57
57
<tp-form-submitsubmitting-text="Submitting...">
58
-
<button type="submit">Submit</button> <-- There must be a submit button inside this component
58
+
<buttontype="submit">Submit</button> <!-- There must be a submit button inside this component-->
59
59
</tp-form-submit>
60
60
</form>
61
61
</tp-form>
@@ -84,3 +84,142 @@ Validates the form.
84
84
### `resetValidation`
85
85
86
86
Removes all validation errors from the form.
87
+
88
+
## Error Summary
89
+
90
+
For accessible form validation, you can add an error summary that lists all validation errors with links to the invalid fields. This follows the [GOV.UK design system pattern](https://design-system.service.gov.uk/components/error-summary/).
91
+
92
+
The component provides maximum flexibility — you control the markup structure.
0 commit comments