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

515 questions
95
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,477
  • 4
  • 32
  • 40
72
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,132
  • 8
  • 45
  • 70
29
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
  • 291
  • 1
  • 3
  • 3
20
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
  • 677
  • 5
  • 19
  • 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
  • 32
  • 53
17
votes
4 answers
16
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,117
  • 16
  • 63
  • 110
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
  • 11,458
  • 22
  • 103
  • 189
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…
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
  • 29,453
  • 35
  • 118
  • 182
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
  • 719
  • 4
  • 14
  • 36
9
votes
1 answer

JAXB does not call setter when unmarshalling objects

I am using JAXB 2.0 JDK 6 in order to unmarshall an XML instance into POJOs. In order to add some custom validation I have inserted a validation call into the setter of a property, yet despite it being private, it seems that the unmarshaller does…
Yaneeve
  • 4,649
  • 8
  • 46
  • 83
9
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
  • 8,216
  • 8
  • 51
  • 99
9
votes
1 answer

CustomValidator not working well

I have the following piece of asp: ...
RanH
  • 562
  • 1
  • 9
  • 25
9
votes
1 answer

Adding an error message to a custom validator

I have a custom validator and I am trying to output an error message when it fails but have been unable to do so. Could someone please tell me if I am doing this in the correct place. class User < ActiveRecord::Base self.table_name = "user" …
Jay
  • 2,882
  • 12
  • 43
  • 88
1
2 3
34 35