Skip to content

custom validation doesnt work on submit #292

@rylofu

Description

@rylofu

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

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?

Metadata

Metadata

Assignees

Labels

questionFurther information is requested

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions