How to call validation function?

How can I manually call the validation function myself when using useModalForm hook?
5 Replies
kapa.ai
kapa.ai2y ago
Hi @script4559. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Hmm, I don't know enough to give you a confident answer yet. The provided extracts do not contain specific information on how to manually call the validation function when using the useModalForm hook. However, you can refer to the Refine documentation (https://refine.dev/docs) for more detailed information. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai2y ago
<@584066183989428345> kapa.ai is still learning and improving, please let us know how it did by reacting below
harsh-harlequin
harsh-harlequinOP2y ago
FIgured it out
const { formProps } = useModalForm({
action: "create",
defaultVisible: true,
});

formProps.form
?.validateFields()
.then((res) => setCurrentStep((prevStep) => prevStep + 1))
.catch((err) => console.error("err", err));
const { formProps } = useModalForm({
action: "create",
defaultVisible: true,
});

formProps.form
?.validateFields()
.then((res) => setCurrentStep((prevStep) => prevStep + 1))
.catch((err) => console.error("err", err));
robust-apricot
robust-apricot2y ago
Thank you for sharing the answer @script4559! 🙏 Have a nice day! 🚀
harsh-harlequin
harsh-harlequinOP2y ago
You, too!

Did you find this page helpful?