xenial-black
xenial-black15mo ago

How to call validation function?

How can I manually call the validation function myself when using useModalForm hook?
5 Replies
kapa.ai
kapa.ai15mo 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.ai15mo ago
<@584066183989428345> kapa.ai is still learning and improving, please let us know how it did by reacting below
xenial-black
xenial-blackOP15mo 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));
conscious-sapphire
conscious-sapphire15mo ago
Thank you for sharing the answer @script4559! 🙏 Have a nice day! 🚀
xenial-black
xenial-blackOP15mo ago
You, too!

Did you find this page helpful?