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
7
votes
2 answers

How to stop Ninject from overriding custom DataAnnotationsModelValidatorProvider?

I have a custom DataAnnotationsModelValidatorProvider for doing model validation in a more dynamic way then just adding attributes. I tried to add my provide to the global.asax.cs like…
sebastiaan
  • 5,847
  • 5
  • 35
  • 64
7
votes
8 answers

Custom validator fires but does not prevent postback

I've seen a lot of questions about this already, but I'm stumped! Please help! I have a customvalidator. It's firing but it's not preventing postback. Please help me in doing so! I can see that console.log registers before the post. But, it posts…
Hoppe
  • 5,820
  • 13
  • 51
  • 102
7
votes
0 answers

Add validation for custom fields in invitation form of devise_invitable

As I know, devise has validation only for email and password, which can be reconfigurated in initializer devise.rb: # ==> Configuration for :validatable # Range for password length. Default is 6..128. # config.password_length = 6..128 #…
Mike
  • 71
  • 2
7
votes
2 answers

Enable/disable RequiredValidator on client-side / CustomValidator not firing

I've got a drop-down where the user selects a Country. It is a required "field". Next to it, there is a textfield named State. If the user selects US, then the field State is required. If the user selects e.g. Sweden, the State is not required,…
Simeon
  • 5,395
  • 3
  • 26
  • 48
7
votes
3 answers

Trim every input field except those with NoTrim attribute

I am working on an ASP.NET MVC 2 application that I didn't create. All input fields in the application are trimmed during model binding. However, I want to have a NoTrim attribute that prevents certain fields from being trimmed. For instance, I have…
6
votes
1 answer

Can i call CustomValidator method on server side without assigning ControlToValidate?

I have 3 RadioButtons from same group, and every radioButton enables its listbox. I want to check if radiobutton was checked and its if items were selected from its listbox. So I"m using CustomValidator with only server side method which checks the…
Eddie Rozenblat
  • 822
  • 2
  • 11
  • 21
6
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…
6
votes
1 answer

ASP.NET Custom Validator + WebMethod + jQuery

I'm trying to implement a .NET Custom Validator that uses $.ajax to query a WebMethod on the same page and return a boolean value to indicate whether the result is true or false. The WebMethod I'm using is really simple [WebMethod()] public static…
Marko
  • 68,081
  • 26
  • 118
  • 153
6
votes
1 answer

Model validation on update in django

I've created a model called Term and a validator for it, like this: from django.db import models from django.contrib.auth.models import User from django.core.exceptions import ValidationError def validate_insensitive_exist(value): …
Falcoa
  • 2,233
  • 1
  • 13
  • 27
6
votes
2 answers

CustomValidator client validation function not firing

I thought that what I was trying to do was rather trivial, but it turns out to trouble me significantly. Here is the situation. I have two radio buttons (implemented using RadButton) and a RadTextBox. I want to check on the client, before…
Lefteris
  • 823
  • 1
  • 7
  • 26
6
votes
1 answer

.NET Web API: Class level validation attribute causes Web API to throw ArgumentNullException if instance is null

I have a DTO class that looks, for example, like this: public class ExampleDto { [DataMember(Name = "Date", IsRequired = true, Order = 1), Required] public DateTime Date { get; set; } [DataMember(Name = "ParentExample", IsRequired =…
dark_perfect
  • 1,438
  • 22
  • 38
5
votes
1 answer

How to validate an attribute with "validates :attribute" referring to the value of a parent object attribute?

In this exercise from O'Reilly's "Head first Rails" (ed. 2009) there are 2 related objects. The "Flight" object [I used annotate gem to show every attribute]: # == Schema Information # # Table name: flights # # id :integer …
Darme
  • 6,470
  • 4
  • 34
  • 50
5
votes
2 answers

Entity Framework Complex Type Custom Validation, Stopping Validation Recursion

We are using complex types to manage our translatable fields like this: [ComplexType] public class Translated { [Required] public string NL { get; set; } [Required] public string EN { get; set; } [ScaffoldColumn(false)] …
5
votes
1 answer

jQuery validate custom rule in data attributes

I have an input text which already has some validate rules
Lorenzo
  • 28,103
  • 43
  • 117
  • 208
5
votes
3 answers

asp.net - manually run client-side validation code from another event

I want to run whatever client-side validation routine is hooked up to a particular text input element. The validation has been set up using CustomValidator:
sennett
  • 6,676
  • 5
  • 39
  • 64
1
2
3
34 35