sacred-roseS
Refine2y ago
5 replies
sacred-rose

Use modalForm Validation with custom submit

I want my custom submit to still check the built in vlaidation provided with the modalForm settings

const { getInputProps, saveButtonProps, modal: { show, close, title, visible, submit }, } = useModalForm({ refineCoreProps: { resource: "skills", action: "create", }, initialValues: { name: "", description: "", curl_cmd: "", status_id: 12, app_id: app_id, }, validate: { name: (value) => (value.length < 2 ? "Too short title" : null), description: (value) => (value.length < 10 ? "Too short description" : null), }, });
Was this page helpful?