We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I find myself in a scenario where I have 4 form fields that need validation only under certain conditions, and no validation in others.
Is conditional validation an option?
The text was updated successfully, but these errors were encountered:
Currently I just keep validation rules in an object and apply conditionally:
if (validateCreditCart) { Object.assign(ccProps, { cardExpiration: { required: true, validations: true }, cardNumber: { required: true, validationErrors: { isCreditCardNumber: 'Invalid card number' }, validations: 'isCreditCardNumber' }, cardCvv: { required: true, validationErrors: { isCreditCardCvv: 'Invalid cvv' }, validations: 'isCreditCardCvv' } }); } … <FormInput classGroup={ classGroup } className={ styles.fieldCreditCardNumber } label="Card number" layout={ layout } name="cardNumber" onChange={ this.onChange } onFocus={ this.clearCCFields } { ...ccProps.cardNumber } />
Is there a better way that you recommend?
Sorry, something went wrong.
No branches or pull requests
I find myself in a scenario where I have 4 form fields that need validation only under certain conditions, and no validation in others.
Is conditional validation an option?
The text was updated successfully, but these errors were encountered: