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: docs/content/3.components/form.md
+8-4
Original file line number
Diff line number
Diff line change
@@ -195,9 +195,13 @@ This will give you access to the following:
195
195
| Name | Type |
196
196
| ---- | ---- |
197
197
|`submit()`{lang="ts-type"} |`Promise<void>`{lang="ts-type"} <br> <divclass="text-[var(--ui-text-toned)] mt-1"><p>Triggers form submission.</p> |
198
-
|`validate(opts: { name?: string \| string[], silent?: boolean, nested?: boolean, transform?: boolean })`{lang="ts-type"} |`Promise<T>`{lang="ts-type"} <br> <divclass="text-[var(--ui-text-toned)] mt-1"><p>Triggers form validation. Will raise any errors unless `opts.silent` is set to true.</p> |
199
-
|`clear(path?: string)`{lang="ts-type"} |`void` <br> <divclass="text-[var(--ui-text-toned)] mt-1"><p>Clears form errors associated with a specific path. If no path is provided, clears all form errors.</p> |
200
-
|`getErrors(path?: string)`{lang="ts-type"} |`FormError[]`{lang="ts-type"} <br> <divclass="text-[var(--ui-text-toned)] mt-1"><p>Retrieves form errors associated with a specific path. If no path is provided, returns all form errors.</p></div> |
201
-
|`setErrors(errors: FormError[], path?: string)`{lang="ts-type"} |`void` <br> <divclass="text-[var(--ui-text-toned)] mt-1"><p>Sets form errors for a given path. If no path is provided, overrides all errors.</p> |
198
+
|`validate(opts: { name?: keyof T \| (keyof T)[], silent?: boolean, nested?: boolean, transform?: boolean })`{lang="ts-type"} |`Promise<T>`{lang="ts-type"} <br> <divclass="text-[var(--ui-text-toned)] mt-1"><p>Triggers form validation. Will raise any errors unless `opts.silent` is set to true.</p> |
199
+
|`clear(path?: keyof T)`{lang="ts-type"} |`void` <br> <divclass="text-[var(--ui-text-toned)] mt-1"><p>Clears form errors associated with a specific path. If no path is provided, clears all form errors.</p> |
200
+
|`getErrors(path?: keyof T)`{lang="ts-type"} |`FormError[]`{lang="ts-type"} <br> <divclass="text-[var(--ui-text-toned)] mt-1"><p>Retrieves form errors associated with a specific path. If no path is provided, returns all form errors.</p></div> |
201
+
|`setErrors(errors: FormError[], path?: keyof T)`{lang="ts-type"} |`void` <br> <divclass="text-[var(--ui-text-toned)] mt-1"><p>Sets form errors for a given path. If no path is provided, overrides all errors.</p> |
202
202
|`errors`{lang="ts-type"} |`Ref<FormError[]>`{lang="ts-type"} <br> <divclass="text-[var(--ui-text-toned)] mt-1"><p>A reference to the array containing validation errors. Use this to access or manipulate the error information.</p> |
0 commit comments