evident-indigo
evident-indigo8mo ago

How to call validation function?

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