#Do validators work with nested fields
15 messages · Page 1 of 1 (latest)
Works correctly on codesandbox – https://codesandbox.io/s/objective-banach-tfuget?file=/src/App.tsx
hmm do input need to be inside a form html element to work
No, you can call validation at any time with form.validate()
yep true, although i m using form.validateField('presence')
or could it be bcz I'm passing form as a prop
so this works const {hasError, error} = form.validateField("presence.nom")
but using the parent object does not const {hasError, error} = form.validateField("presence")
so when using form.validateField() you should specify exactly the field not the parent or else no error will be displayed in the in the input
@viral delta know any work around for this
I do not think there is one
will was hoping to validate each section and kinda make it a little bit easy for me hhh
@viral delta so looking in react dev tools component state is look like the useForm hook does have an Error when selecting the parent object the one to be validated using validateField() it just has one error only though hope that helps