absent-sapphire
absent-sapphire9mo ago

useForm Mantine

Hey guys, how can I reset form after submit form successfull with useForm ( mantine ) ?
2 Replies
kapa.ai
kapa.ai9mo ago
Hi @mandado. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- To clear the form fields after a successful submission using the useForm hook in Refine, you can use the reset function. You can call this reset function in your onFinish handler after the form is submitted successfully. Here's an example:
const { formProps, reset } = useForm({
onSuccess: () => {
reset();
},
});
const { formProps, reset } = useForm({
onSuccess: () => {
reset();
},
});
In the above code, the reset function is called in the onSuccess callback of the useForm hook. This will clear all the form fields after a successful form submission. Please note that this information is based on the Refine framework and its integration with Ant Design System. If you're using Mantine, you might need to refer to Mantine's specific documentation or support channels for accurate information. Source (https://discord.com/channels/837692625737613362/1165992447659212912) ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai9mo ago
<@121754827691786243> kapa.ai is still learning and improving, please let us know how it did by reacting below