I created a form, and the <TextField /> sends only string, how can I do to send Number ?
I create a model:
https://codesandbox.io/s/dropdown-0lscxf?file=/src/pages/posts/CreatePostModal.tsx
the form is inside the dropbox "nuova persona".
3 Replies
Hi, I am refine support bot :wave:. I am here to help you with your question. I searched for the answer to your question in the refine documentation and found an answer! 🏆 If this is the answer you need, then we are very lucky. If not, please wait for someone from the refine core team or the community to try to help you.
Answer: You can use the type="number" attribute in the <TextField /> component to send a number. SOURCES: ./docs/api-reference/mui/components/basic-views/edit.md
Answer: You can use the type="number" attribute in the <TextField /> component to send a number. SOURCES: ./docs/api-reference/mui/components/basic-views/edit.md
apparent-cyan•2y ago
Hi @_leonardomuniz, thanks for reproduced code 🙏
you can use this
valueAsNumber: true,
you can read more information here:
https://react-hook-form.com/api/useform/register/itchy-amethystOP•2y ago
That was much easier than I thought, thank you very much, including the documentation, I will read it.