This is a migrated thread and some comments may be shown as answers.

Validate only if the input field as data

1 Answer 559 Views
Validation
This is a migrated thread and some comments may be shown as answers.
Philip
Top achievements
Rank 1
Philip asked on 22 Mar 2017, 07:37 PM

We want to validate only if the user has inputed any data into a form field. So basically no fields are required, but if for some reason they filled out the email address field we want to make sure it a valid address.

How would we use the Validator in this use case in an MVVM pattern.

Thanks in advance

1 Answer, 1 is accepted

Sort by
0
Alex Hajigeorgieva
Telerik team
answered on 24 Mar 2017, 12:42 PM
Hi Philip,

You can use the Kendo UI Validator with a custom rule. I have modified the official demo of the validator to show you:

http://dojo.telerik.com/erAPi

Additionally, since you are using MVVM, you may find the below how-to article useful as well:

http://docs.telerik.com/kendo-ui/controls/editors/validator/how-to/validator-in-mvvm

Kind Regards,
Alex Hajigeorgieva
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data (charts) and form elements.
Tags
Validation
Asked by
Philip
Top achievements
Rank 1
Answers by
Alex Hajigeorgieva
Telerik team
Share this question
or