iirc there was a feature for this on the numberinput component.
https://github.com/mantinedev/mantine/issues/763
What would this be for the textinput?
I get an error when I try to use either formatter or parser insise of my component: tsx <TextInput withAsterisk classNames={classes} placeholder={placeholder} label={label} {...form.getInputProps(name)} />
#TextInput component parser
7 messages · Page 1 of 1 (latest)
just tried this ts validate: { id_number: (value)=> value.toUpperCase(), }, also didnt work
feel free to ping me
i managed to do it onsubmit with this:
https://mantine.dev/form/values/#transformvalues
const form = useForm({
initialValues: {
first_name: "",
last_name: "",
phone_number: "",
id_number: "",
termsOfService: false,
},
validate: {
first_name: isNotEmpty("Voornaam mag niet leeg zijn"),
last_name: isNotEmpty("Achternaam mag niet leeg zijn"),
phone_number: isNotEmpty("Telefoonnummer mag niet leeg zijn"),
id_number: isNotEmpty("Id nummer mag niet leeg zijn"),
},
transformValues: (values) => ({
...values,
id_number: values.id_number.toUpperCase(),
}),
});```
bit what I actually want is to transform the value not on submit but onChange.
How do I do that?