Redux-form: how can I mutate field by onSubmit

30 Views Asked by At

I have to clear the Account field if I change the Partner field. How can I do this with the onSubmit event using Redux-form?

Example code:

 <form onSubmit={handleSubmit}>
            <BoxBlock>
                <Row>
                    <Col md={3}>
                        <Field
                            name={FORM_FILTER_NAMES.PARTNER}
                            label="Partner"
                            placeholder="Choose a partner"
                        />
                    </Col>
                    <Col md={3}>
                        <Field
                            component={MultiSelect}
                            name={FORM_FILTER_NAMES.ACCOUNT}
                            label="Account"
                            options={sortedAccounts}
                            placeholderOption="Choose account"
                            loaded={accountsLoaded}
                            isSearchable
                        />
                    </Col>
                </Row>
                <div className="d-flex justify-content-between">
                    <Button
                        className="pull-right"
                        bsStyle="primary"
                        type="submit"
                        disabled={submitting || pristine}
                    >
                        Filter
                    </Button>
                </div>
            </BoxBlock>
        </form>
0

There are 0 best solutions below