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

learn more… | top users | synonyms

3
votes
2answers
52 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 ...
3
votes
1answer
55 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 ...
2
votes
0answers
31 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
74 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
19 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
62 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
52 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
45 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
65 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
112 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
31 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
46 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
100 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
70 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
75 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
93 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
33 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
26 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
94 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
292 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
38 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
41 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
111 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
78 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
80 views

Using decorator pattern to validate an entity

I am following this article. ...
5
votes
2answers
86 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
33 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
54 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
90 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
207 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
100 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
38 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
93 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
1k 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
61 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 ...
3
votes
2answers
56 views

Streaming a Pin more natively

In my quest to better myself, it's time for the C++ version of my StreamingPin class, and all relevant helper classes. The F# version: Streaming a Pin functionally(...
1
vote
0answers
43 views

CodeIgniter MVC Controller to validate and save a form

I feel although my controller is over complicated and more should be moved to the model. I've read that the controller shouldn't contain any logic, and just call the model/view, however it currently ...
7
votes
1answer
83 views

Streaming a Pin functionally(ish)

Earlier today I wrote a question (Validating a StreamingPin) and I thought it was a good idea (apparently I was the only one who thought so, but whatever), so I proceeded further with it and developed ...
6
votes
1answer
72 views

Validating a StreamingPin

Recently I was thinking about the keyless entry on my car and how simple it has to be, so I wrote a C# programme to validate a StreamingPin, that is, a pin that is ...
2
votes
1answer
73 views

Registration form validation in jQuery

I have created a registration form using jQuery. I am validating username and password using an AJAX request. The "submit" button is originally disabled and is only enabled when all three fields of ...
1
vote
0answers
146 views

Spring MVC validation Multipart file in form

I need make validation of Multipart file in form class. I wrote custom annotation for form class which validate Multipart file. This code works great, but I don`t know if this is a good approach. ...
2
votes
2answers
78 views

Simple JavaScript precondition checking implementation

I am writing a JavaScript application and would like to validate function arguments in many places. Most of these checks will be for correct argument types, or numeric values within specific ranges. ...
1
vote
2answers
47 views

Form validation for user account creation

What would be a cleaner way to write the following? ...
0
votes
1answer
37 views

Validating search parameters in an Angular $scope

I am using the following function to make a specific filter passing the $scope.searchParams in this way: ...
3
votes
0answers
41 views

JavaScript validator plugin

Please help me to improve the JavaScript validator plugin by making it more OO and robust. Requirement is to trigger the validation if there is an attribute ...
0
votes
1answer
54 views

jQuery array of functions validation

I am attempting to validate a set of business rules in order for a user to successfully add to cart. The rules vary from requiting to add/decline a requested add-on to not having more then 60 items in ...
1
vote
1answer
60 views

Make sure the user enters a valid floating-point number in C

I would like to know if this is a good way to make sure the user enters a valid number. ...
3
votes
1answer
45 views

Validation rules with support for immediate termination of processing

I am picking up a code smell from this code and I am not sure of the best way to rid myself of it. I have a validation class that has a function that returns a list of ...
2
votes
1answer
32 views

Change passwords after being validated

I recently posted a program that I wrote that would change a password after being validated, the program can be found here. I have rewritten this program, it has a couple new features: Usernames ...