Custom control not validating

I had already found out that the standard approach (args.value) doesn't work because the value isn't sent to the function from these controls.

For anybody else copying this, please not that the snippet Princy supplied needs a small modification.

The client validation function property on the custom validator should read: Princy, OK, well you've solved my problem so thanks again.

The input parameter is a form control, and the output is either an error object or null if the value is valid.

So here is what that method would look like: The above code defines our directive that implements the Validator interface.

Hi, I'm using a Rad Grid with a popup form for editing and inserting records based on the excellent Edit Form types demo.

Everything I used from the demo works fine but I ran into a problem with validation.

Form validation is always a hot topic whenever I teach Angular.

People usually ask me whether they should use Template driven forms or Reactive forms, and I used to tell them that reactive forms are a better option when you need custom validators.

The above form would be invalid as long as the user does not enter a credit card number that passes our validation criteria.

Now let’s add some error handling to render the right error message from our validator function: My name is Alain Chautard.

Unlike the demo I'm using some controls that can only be validated using a custom validator function (Rad Editor and Rad Rating).

931 Comments

  1. Its high rate of subscribers engaging in romantic relationships and meeting live partners makes it a one-stop dating site.

  2. Chat Random - this is a random video chat, access to which is absolutely free.

  3. Your friend will appreciate the little efforts you make on their behalf.

Comments are closed.