ui/form_state.svelte.ts view source
form
Creates a form attachment that handles Enter key advancing between
focusable elements and tracks field touched state via delegated focusout.
Fields are identified by their name attribute.
type (): Attachment<HTMLFormElement>
Attachment<HTMLFormElement>is_touched
Whether a field has been blurred at least once.
type (field: string): boolean
field
stringbooleanshow
Whether to show validation errors for a field.
Returns true if the field has been blurred or a submit attempt was made.
type (field: string): boolean
field
stringbooleantouch
Programmatically marks a field as touched without requiring a blur event.
type (field: string): void
field
stringvoidfocus
Focuses the named input within the form.
type (field: string): void
field
stringvoidattempt
Marks the form as having been submitted, causing all field errors to show.
type (): void
voidreset
Resets all touched and attempted state.
type (): void
void