Questions tagged [customvalidator]

The .NET `CustomValidator` class that allows custom validation of any UI input element

The .NET CustomValidator class that allows custom validation of any UI input element

557 questions
96
votes
4 answers

Where should Rails 3 custom validators be stored?

I've seen docs/websites show that custom validators should go in a /lib or /lib/validators directory of a project. I've found (by reading an answer to another post) that they only seem to work in config/initializers. Does anyone know, or have a…
Daniel D
  • 3,637
  • 5
  • 36
  • 41
75
votes
7 answers

ASP.NET Custom Validator Client side & Server Side validation not firing

This has not happened to me before, but for some reason both the client and server side validation events are not being triggered:
REA_ANDREW
  • 10,666
  • 8
  • 48
  • 71
42
votes
4 answers

Display custom validator error with mat-error

I come to you for talking about a problem with angular material. In fact, I think it's an issue, but I prefer looking for a misunterstanding first. The first thing about my problem is the context, i try to do a simple form containing two inputs : a…
Pouette
  • 423
  • 1
  • 5
  • 8
30
votes
8 answers

asp.net custom validator not firing for textbox

I have both a required field validator and custom validator for validating a texbox. The required field validator fires perfectly. I'm not able to get the custom validator to fire properly?
Eric Savard
  • 301
  • 1
  • 3
  • 3
24
votes
4 answers

"pydantic\validators.py" : no validator found for

Below DataFrame of pandas is not validated by pydantic. How to handle this? from pydantic.dataclasses import dataclass @dataclass class DataFrames: dataframe1: pd.DataFrame = None dataframe2: pd.DataFrame = None This throws the following…
21
votes
3 answers

Dynamic error message for custom validator clientside

I am using a custom validator to call a javascript function for validation. My problem is that I need to be able to change the error message dynamically. Here is the code:
Mike
  • 713
  • 6
  • 20
  • 41
19
votes
7 answers

Elegant way to make CustomValidator work with ValidationSummary messagebox

I have run into this problem before but never quite solved it. I have a form with several validators and also a CustomValidator.
Alfero Chingono
  • 2,663
  • 3
  • 33
  • 54
17
votes
4 answers
17
votes
2 answers

ASP.NET Custom Validator Error Message: Control referenced by the property cannot be validated

I use ASP.NET and have a Button and a CustomValidator, which has to validate the button.
AGuyCalledGerald
  • 7,882
  • 17
  • 73
  • 120
12
votes
2 answers

CustomValidator ServerValidate method does not fire

I've put a CustomValidator on my form. I have not set its ControlToValidate property. In its ServerValidate event I've written the following: protected void CustomValidator1_ServerValidate(object source, …
Mikayil Abdullayev
  • 12,117
  • 26
  • 122
  • 206
11
votes
2 answers

Spring 3.1 Autowiring does not work inside custom constraint validator

I have an issue with bean autowiring inside a custom constraint validator. A constraint validator instance is not given using Spring's LocalValidatorFactoryBean. The JSR-303 provider is hibernate-validator 4.2.0.Final. Spring configuration excerpt…
11
votes
4 answers

Get error message when using custom validation attribute

I'm using the CustomValidationAttribute like this [CustomValidation(typeof(MyValidator),"Validate",ErrorMessage = "Foo")] And my validator contains this code public class MyValidator { public static ValidationResult Validate(TestProperty…
marcus
  • 9,616
  • 9
  • 58
  • 108
9
votes
2 answers

set errormessage for customvalidator?

I would like to use a customvalidator control to handle all my validation, but I can't figure out how to set the error message in the code-behind for different checks. Is this possible?
chobo
  • 31,561
  • 38
  • 123
  • 191
9
votes
1 answer

custom validator for checkbox in asp.net

i have used custom validator protected void cvIsActive_ServerValidate(object source,ServerValidateEventArgs args) { if(args.Value.Length==1) args.IsValid = true; else args.IsValid =…
deepti
  • 729
  • 4
  • 17
  • 38
9
votes
1 answer

Angular 5: Module not found: Error: Can't resolve '@angular/forms/src/validators'

I am trying to create a custom validator using directive but getting below error. ERROR in ./src/app/CustomValidators/white-space-validator.directive.ts Module not found: Error: Can't resolve '@angular/forms/src/validators' in…
1
2 3
37 38