Manually modify the error state of the field
I want to initiate a request after passing a form validation. I can only know which form fields are illegal after the request is returned. Is it possible to modify the field status?

5 Replies
eastern-cyan•16mo ago
You need to modify the
errorMap, not errorsrival-blackOP•16mo ago
@crutchcorn Can you give me a code example? I feel a little stuck.😠ðŸ˜
eastern-cyan•16mo ago
S'all good 🙂 I'm not avail to give a full code sample at the moment (CC @Leonardo might be able to help) but will get back to you later today if nothing else
rival-blackOP•16mo ago
Many thanks🥹
foreign-sapphire•16mo ago
This seems like a good use case to extend our
FieldValidateFn to also take an async function, then you could use await mutateAsync inside a validator and return strings so that the form will handle where to put them (inside errorMap) 🤔
Anyway @awn with this snippet you can set errors manually and you will find them already into the errors array of a form or a field