Validation is used to check data to make sure it fits whatever required specifications are set for it.

learn more… | top users | synonyms

4
votes
0answers
14 views

Excel VBA object with validated bounds for an interval

I'm working through a problem I have with Excel VBA. I have two object classes. Class clsLoadStep stores three copies of class clsLoad objects. Class clsLoad simply stores a value and a string stating ...
3
votes
1answer
31 views

Library to verify GTINs of various lengths

I'm writing a library to verify GTINs (GTIN-8, GTIN-12, GTIN-13, GTIN-14) and calculate their check digits. The calculation of the check digits don't differ from type to type, so I can use the same ...
5
votes
1answer
178 views

Validating input variables

I have written the following JavaScript code and want to ask if it is written as per best practices. Please recommend any changes to be made in the code. The code is taking a few variables as input ...
1
vote
1answer
45 views

Validation form JavaScript

I am a beginner to JavaScript and I know about jQuery Validations however I do not want to use a foundation like jQuery just yet. I am wondering if what I have done its good or if there is another ...
3
votes
1answer
53 views

Instantaneous validation of form field length

Since I have a function which can be done in few ways as usual, I was wondering which way is the best to achieve the form validation where I have only one input field, and I am showing a warning on ...
8
votes
5answers
240 views

Validate input that maps int to enum

I've written the following enum and have added a function, fromValue that allows the caller to map given int into the enum value. I was wondering if the ...
2
votes
1answer
46 views

Parse the response from http call and populate multiple maps

I have to parse a response after making HTTP call on the server. If the response is not successful then try another server otherwise parse the successful response and populate two ...
0
votes
3answers
24 views

Opening and validating an XML file

I have a section of code that repeats many lines and I am looking to refactor this code possibly so that a function can be used instead of the same lines of code each time. Below is the section of ...
5
votes
2answers
77 views

Validation sequence

...
3
votes
3answers
132 views

Function to check if a date is correct

I have a method that checks if a date is correct or not, which returns a boolean if it is or not. In the method, I first check the format, then the date by using the function ...
0
votes
2answers
70 views

Validate particular id's depending on what process type is coming

I have code where I validate deviceId and clientId basis on what ProcessType is coming: <...
2
votes
0answers
28 views

IE8 Form Validation

I am writing a custom form validation script compatible with IE8+. I just wanted to make sure I am not messing anything up. I have tested on IE8 its works. However, I want to make sure I am doing it ...
1
vote
1answer
63 views

TypeScript JSON-Array Validator

For my latest app I wanted to be able to code the front-end first, without having to do super extensive documentation and without forgetting my data types later on while coding the back-end. I thus ...
4
votes
1answer
96 views

ValidationAttribute to validate a string against a JSON schema

This is my implementation of an .NET ValidationAttribute to validate a string against a JSON schema. The JSON schema file is stored within the application as an ...
3
votes
2answers
67 views

Validation Extension method performance

I'm writing a simple set/framework of extension methods for argument/parameter validation. What I'm mostly concerned about, ATM is the performance, against the simpliest boilerplate ...
4
votes
1answer
76 views

One time key for authentication

In a recent project I was to create a web service that would be consumed by another application. One of the requirements was to have a key in the service that authenticated the request as valid. But ...
3
votes
2answers
104 views

Asking the user to input a proper email address

The purpose of this code is to ask the user to input an email address but it must contain "@" and ".co". The code works but it is too long so I would like to know if there is any way to shorten it ...
2
votes
1answer
85 views

Adding various types of configurable validators to fields

I am currently reworking our entity code generator, that uses JaxB for schema validation, and Stringtemplate for code generation. As we are giving our professional service the possibility to add ...
4
votes
0answers
50 views

Unit tests for React component to submit an input form with validation

I'm very new to front-end/unit testing and have been having a difficult time understanding the point altogether, but I managed to push my way through testing literally everything I could possibly ...
0
votes
0answers
68 views

Ajax Validation Handler

I'm trying to transition my app from a collection of server scripts to something that uses SOLID concepts. I'm stuck trying to figure out a better way to do ajax validation. I currently have a file ...
-1
votes
1answer
60 views

Patten matching to check for non-empty argument list

I'm learning Elixir. while building a trivial cli application (as seen here http://asquera.de/blog/2015-04-10/writing-a-commandline-app-in-elixir/) I'm defining a module that implements a ...
1
vote
1answer
121 views

Custom checkbox validation on submit

I have the code below which is working as expected. It is doing a form validation with Vue.js and Vee-Validate. It is checking that at least one checkbox is checked. I only don't like that I have to ...
2
votes
1answer
72 views

Validation for registration password

Could someone tell me if this is a bad idea for coding my validation for a password and it is bad? This is for registration for my site. Could you please tell me why and how you would go about it (I ...
3
votes
2answers
113 views

Method for validating properties based on passed conditions

I wrote a method for validating properties based on passed conditions. It works well, but declaration takes more space than the actual condition. Is there any way to make it shorter? ...
1
vote
0answers
37 views

Validating each process object from its own validator

I have two processes, and for each process, I will get different GenericRecord object (this is an open source classes) and I need to validate those ...
3
votes
1answer
54 views

Perl module validate quoted string literal, test with Test::LectroTest

I guess for some motivation: I ripped this out of a larger library I'm half-working on to parse S-expressions and cleaned it up a bit. I'm trying to write a simple function that tests whether a ...
6
votes
3answers
104 views

Weekday+day validation

The string I'd like to check is something like "abcSun24def". If any valid "xxxyy" (xxx = weekday and yy = day) is found, return the position inside the string. If "xxxyy" is not found, return -1. ...
0
votes
1answer
83 views

Validation on two different classes and passing one object including everything to another class

I have two consumers and each consumer has their own validation logic entirely different from one other so I am using two validator class for that, one for each other. ...
20
votes
10answers
4k views

Verifying a person's age

When coding I noticed I started to get into a habit of not using if-else statements when the else block only has one line of code. For example, if I have code that can be solved like this: ...
4
votes
1answer
80 views

Validate the inputs and perform actions accordingly

I have a consumer which is listening to Kafka and from which I am getting avro GenericRecord. Now basis on GenericRecord ...
3
votes
1answer
168 views

PHP Validate JSON objects with a JSON schema

I have a basic JSON API written in PHP. I want to validate incoming JSON data. I know there are PHP JSON validators out there, here is a quick one I just rolled up. ...
0
votes
1answer
39 views

Validating only attributes that are present in a form [closed]

I want to skip validations based on attributes. If certain attributes are not in form so I do not want to validate them. Currently, if I post them from one form which has 1 field, it still validates ...
3
votes
1answer
27 views

Single Validation function, called once per Animation function

Just looking for a way to include a single validation function inside of another function, that will stop any other lines from executing if it fails. NOT an if statement... I'm trying to avoid ...
1
vote
2answers
105 views

Validator Class in PHP

I am trying to create a validation class that can be used to validate many forms of my webpage in general. It makes use of the database as well to verify records. The problem with it is that it ...
5
votes
3answers
354 views

Custom exception for string that is too long

This is my first time working with Java exceptions. I have made a program that works to specifications, but I am wondering if there is anything I've done which is unconventional or not recommended. ...
2
votes
0answers
39 views

Expression validator service

I'm working on a project (in C++98) that uses a grammar validation service to validate mapping expressions for a small DSL. To simplify the project code, I've written a small interface for using the ...
1
vote
2answers
45 views

Validating Input concerns

I would like to find out if there's a cleaner way to go about validating input before it goes into a function. What I'm doing seems like a lot of code, I'm sure there's a better way. I would also ...
5
votes
2answers
197 views

Form that reveals more fields as each step has been completed

I'm new to JavaScript and jQuery and need input about how to optimize my script: ...
4
votes
1answer
81 views

Code that uses reflection to validate arguments

I wrote an answer to this question on the Software Engineering SE site and was hoping to get it critiqued. (I'm told that it's acceptable to do so). Essentially, this code uses reflection to check to ...
1
vote
1answer
91 views

Using decorator pattern to validate an entity

I am following this article. ...
5
votes
2answers
101 views

Simple Java password rule enforcing

rule 1: length must be between 8 and 50 chars. rule 2: at least 3 of the 4 following rules: --------2a: at least one upper case --------2b: at least one lower case --------2c: at least one numeral ----...
0
votes
0answers
41 views

File attachment validation from contact form

I'm relatively new to PHP programming and working on the server side, and I have this HTML contact form allowing people to upload a .doc, .docx, or .pdf file with the intent of emailing this uploaded ...
2
votes
1answer
70 views

Validation of a couple of model classes using FluentValidator

A couple of model classes are doing the validation using FluentValidator. These model classes are used to Add and Edit the branch data and they are working well but ...
1
vote
4answers
99 views

Validating user input in C# coming from XAML controls

I have page where I am inserting some data into Entry fields. For each Entry I have written in XAML different controls with parameters. One of them is Formated parameter where I am giving a string ...
1
vote
1answer
208 views

Making the parsing of a String to an Int32 robust (valid, positive, not 0 validation)

I've a static method which parses a String (from the App.config) to a Int32. I need to have a valid (since the parsing would fail of course^^), positive and not zero integer. I've done it like this: ...
1
vote
2answers
112 views

Yet another PHP MVC form validation

I'm working on my own "MVC" framework for learning purposes and for personal use. I use the "MVC" expression as a concept not a concrete design pattern. So I refer to MVC as a "separation concept" not ...
1
vote
1answer
63 views

Rails form helper to display email fields and their validation errors

I have a repeated pattern throughout my app that looks like this: ...
0
votes
3answers
111 views

Validate optional input parameters with if(!empty)

I have a function which accepts four parameters, which are all optional. Once they're received, it validates using if(!empty). ...
8
votes
3answers
2k views

Password Validation in Python

I coded a python solution for the question below. I am after the fastest solution. Also, I would be grateful if you could point out parts that are not pythonic / inefficient. Question: A website ...
4
votes
1answer
67 views

Validating attributes of a page in Adobe Experience Manager

I am reviewing the following code written by a fellow developer. I am not an java expert but IMHO i did not feel this is efficient use of exceptions — the reason I feel so is: The below code throwing ...