Skip to content
New issue

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

only validate a single field #495

Open
Blurri opened this issue Jun 6, 2018 · 2 comments
Open

only validate a single field #495

Blurri opened this issue Jun 6, 2018 · 2 comments

Comments

@Blurri
Copy link

Blurri commented Jun 6, 2018

Hi,

We have a registration form. And we want to check on blur if the email is available.
Now is it somehow possible to only validate and show a error for this email field
without validating the complete form with form.getValue() ?

@ishigamii
Copy link

This feature would be very useful maybe PR

@thnardi
Copy link

thnardi commented Feb 3, 2019

to validate only a filed you can use something like that: this.formRef.getComponent('email').validate() - you will validate only this field.

by validate, as far as i know, this tcomb-form-native, verify if the field value satisfy the type (or subtype) conditions..

if you need to satisfy your condition async in an external source, i belive it will not be possible by the subtype definition, because the tcomb-form-native only work (again, as far as i know) with synchronous code.

I solved this in my solution by ignoring the 'validate ()' function and modifying the field option directly by change the 'hasError' using t.update() .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants