Questions tagged [validationrules]

A validation rule is a criterion used in the process of data validation, after the data has been encoded onto an input medium. This is distinct from formal verification, where the operation of a program is determined to be correct per the specification.

A validation rule is a criterion used in the process of data validation, after the data has been encoded onto an input medium. This is distinct from formal verification, where the operation of a program is determined to be correct per the specification.

An example of a validation check is the procedure used to verify an ISBN:

  1. Size. The number of characters in a data item value is checked; for example, an ISBN must consist of 10 characters only (in the previous version – the standard for 1997 and later has been changed to 13 characters).

  2. Format checks. Data must conform to a specified format. Thus, the first 9 characters must be the digits 0 through 9, and the 10th must be either one of those digits or an X.

  3. Consistency. Codes in the data items which are related in some way can thus be checked for the consistency of their relationship. The first number of the ISBN designates the language of publication. for example, books published in French-speaking countries carry the digit "2". This must match the address of the publisher, as given elsewhere in the record.

  4. Range. Does not apply to ISBN, but typically data must lie within maximum and minimum preset values. For example, customer account numbers may be restricted within the values 10000 to 20000, if this is the arbitrary range of the numbers used for the system.

  5. Check digit. An extra digit calculated on, for example, an account number, can be used as a self-checking device. When the number is input to the computer, the validation program carries out a calculation similar to that used to generate the check digit originally and thus checks its validity. This kind of check will highlight transcription errors where two or more digits have been transposed or put in the wrong order. The 10th character of the 10-character ISBN is the check digit.

Source: Wikipedia

189 questions
1
vote
1 answer

C# WPF Bindings, ValidationRule and default value

I new to WPF and C# and I have a problem with my application. I have a TextBox which I want to have a ValidationRule on to validate the text. Now I want to have a default value in the TextBox but i can't figure out how to do it. I've tried alot of…
chiefi
  • 101
  • 3
  • 12
1
vote
1 answer

DataGridTextColumn ValidationRule with parameter hibernateConnector not working

I try to implement a ValidationRule for a DataGridTextColumn that should test the nullability against a NHibernate property. The check is actually done within my HibernateConnector.isNullable(String className, String propertyName) method. Therefore…
user7399085
  • 220
  • 1
  • 12
1
vote
0 answers

MS Access 2010, Validaton Rule: Query-based Fields 1, 2 and 3 cannot be equal to each other

I have a table that has FiscalLider, FiscalDia and FiscalNoite fields, their values comes from a Query and if I choose a name for one field that name should not be used on the other two fields, like this: Value FiscalLider can´t be used on Value…
CubaRJ
  • 11
  • 4
1
vote
1 answer

Adding an ExceptionValidationRule to a Binding in code

I have been developing an ErrorProvider control that inherits from Decorator. It validates any elements within the control that are bound to something. It loops through every binding and within a FrameworkElement and adds an ExceptionValidationRule…
Frinavale
  • 3,908
  • 10
  • 44
  • 74
1
vote
2 answers

WPF ValidationRule: How do I know what I am validating?

Ok, so I tried to create a ValidationRule to ensure that the set width of an item is within a given range for that item. Here is my attempt: public class AdjustWidthValidationRule : ValidationRule { public override ValidationResult…
Jordan
  • 9,642
  • 10
  • 71
  • 141
1
vote
1 answer

Laravel validation if field one is filled field two should be empty

How can I validate if field end_date is filled, field start_time should be empty? something like: 'start_time' => 'empty_with:end_date' public function rules() { return [ 'start_date' => 'required', 'end_date' =>…
nature
  • 307
  • 5
  • 23
1
vote
0 answers

WPF DataGrid Property for Validation Error

I have three tabs, TabItem1, TabItem2 and TabItem3. In TabItem1, I have a DataGrid (MyDgr) in which the columns have been binded with ValidationRules. The Validation Rules are working just fine and are catching entries with non-desired format (and…
Nodame
  • 1,053
  • 3
  • 12
  • 18
1
vote
1 answer

Salesforce Validation Rule - Allow certain user & profile to modify record after it's been approved

I've looked for answers and even looked at a lot of our other validation rules but can't quite seem to finish this off. I feel like I'm almost there but I can't get my syntax correct. I'm trying to write a Validation Rule that would allow a…
Ryan McKnight
  • 11
  • 1
  • 3
1
vote
0 answers

WPF ValidationRule bug? Backspace is ignored. Is there a work around for this?

My work mate is having this problem as well, we haven't had a chance to do much in the way of investigation. Steps that reproduce the problem in a textbox in a datagrid with a validation rule attached. Enter some illegal content in such a way that…
handles
  • 7,639
  • 17
  • 63
  • 85
1
vote
2 answers

create validation rule "start with upper letter" access

I want to create a validation rule in access for a field which allows just values which start with Upper letter I've tried this code:StrComp ( UCase ( right([Nume],1)), right([Nume],1)=0 ,but it doesn't work
1
vote
2 answers

Advice needed regarding validation in MVVM

I'm converting one of my existing applications to the MVVM pattern to improve its structure and I'm a bit torn on what would be the best way to do the data validation. Currently the application uses data binding to link the UI and code and uses a…
Moonshield
  • 925
  • 9
  • 16
1
vote
0 answers

jquery group level validations

I am doing client side validation in jQuery. I have 3 fields and I want to write rules that atleast one of these fields should be filled. So I write a code like this. "Address.FlatNo": { require_from_group: [1, ".building-group"], …
Fahad Farooqi
  • 117
  • 1
  • 2
  • 14
1
vote
0 answers

WPF BindingGroup Validation Rule not firing

I'm new to WPF. I was trying to apply a validation rule to two text boxes in order to compare if their values are the same. I came across BindingGroups and decided to try it out. But now, I find that my validation rule isn't getting triggered. Could…
Ashwini Nayak
  • 17
  • 1
  • 6
1
vote
4 answers

Laravel5.1 jsValidation Unique rule issue

I'm using laravel-jsValidation, https://github.com/proengsoft/laravel-jsvalidation, everything is working fine except Unique rule ! Here what I have : Rules : protected $userValidate=[ 'lastname' => 'required|max:100|min:2', …
BKF
  • 1,298
  • 4
  • 16
  • 35
1
vote
1 answer

BindingGroup with multiple (failing) ValidationRules

I ran into a problem today at work wherein I have a BindingGroup that has multiple ValidationRules that are failing simultaneously. Problem is, I get an ArgumentException bubbling up from withing BindingGroup.ValidateWithoutUpdate when I try and…
Nathan Ernst
  • 4,540
  • 25
  • 38