does form.validate() or form.validateField() work similar to form.initialize()? I'm fetching form data and initializing it afterwards. But validating field using form.validateField doesn't seem to work. Specifically, i want to validate all of the input fields so that any matched values between all the inputs should trigger the error for the input fields. thanks
#Form validate
9 messages · Page 1 of 1 (latest)
I did not get the question
basically i want to add validations after creating the form , not inside useForm. is it possible?
What does creating the form mean?
form = useForm()
we can initialize it after declaration. im asking if a similar thing possible with validations
You can perform any custom data validation logic with validate function – https://mantine.dev/form/validation/#function-based-validation
i need to use field names here, but i do not know them beforehand. i fetch form data and then i use form.initialize() inside useEffect to populate the fields.
You can return an object with any field names from the validate function