ITADN

custom validation doesnt work on submit

#292Openrylofu 创建于 2025-06-09
question
R
rylofucommented
I have a delivery form with a flat field and a noFlat checkbox. When the form is submitted, I need to check that if noFlat is not checked, then flat is required. I have a simple function to check this ```js const validateFlatRequired = (value: Maybe<FieldValue>): MaybePromise<boolean> => { const noFlatValue = getValue(DeliveryFormStore, "noFlat") if (!value) { return noFlatValue === true } return true } ``` but it only works on input (verified using console.log inside it). Is this expected behavior?
2 条评论