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
The behavior I'm trying to achieve is to show the validation errors after the user submit the form, the default behavior is validating on keydown as soon as the input is touched.
Here is the solution that i tried:
<scriptlang="ts">
import {createForm,getValue} from 'felte';
import {validator} from '@felte/validator-zod';
import {schema} from '$lib/validation/sign-up-schema';
const {form,errors,unsetField,validate} = createForm({extend: [validator({ schema })],onSubmit: (v,{ form })=>{validate()form?.submit();}});
unsetField("email")
unsetField("password")
unsetField("passwordConfirm")
</script>{#each Object.entries($errors)as[label,message]}{#if message}<divclass=""><divclass=""><h5class="">Error: {label} is invalid</h5><p>{message}</p></div></div>{/if}{/each}<formuse:form>
/.../
</form>
I hope this is not a duplicate, Thanks in advance.
The text was updated successfully, but these errors were encountered:
Hello, Great package btw,
The behavior I'm trying to achieve is to show the validation errors after the user submit the form, the default behavior is validating on keydown as soon as the input is touched.
Here is the solution that i tried:
I hope this is not a duplicate, Thanks in advance.
The text was updated successfully, but these errors were encountered: