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

learn more… | top users | synonyms

1
vote
0answers
46 views

Updating many fields based on data from a web service

I have to receive data from a webservice and need to compare the received data with the data in our DB. Its easy like: get a streetname from the WS, if its not null and not equals the Db entry -> ...
0
votes
2answers
86 views

Validating input values in C#

I began studying C# 5.0 a few days ago and am trying to avoid duplicated code for validation of input values. ...
1
vote
1answer
30 views
1
vote
1answer
26 views

Validation of uploading images and adding records to the database

I am doing a php project with the codeigniter framework. In my controller, I have a function that does the following. Uploads an image to the server Add a row to the database. The data would be ...
1
vote
1answer
85 views

Implementation of API to create a company account in a database

I'm working on an API that has a lot of controller functions like this: ...
4
votes
1answer
45 views

Validating company registration numbers

N.B. The next stage of this project, which covers parsing filenames and checking numbers against the list produced in this question, is covered here. I have a list of company numbers (UK companies ...
4
votes
1answer
43 views

Conditional async validation function

We have the following validation function: ...
1
vote
0answers
21 views

Custom bang! method and Rails validation

I have a model called booking. ...
-1
votes
0answers
19 views

Guidelines for returning None vs. raising exceptions for Python string-validating functions [migrated]

Let's say we have a function that checks if a given pattern occurs in a string. The default behaviour is that if the pattern matches, then it returns the pattern. So far so good but what is the ...
1
vote
0answers
36 views

Angular validation function for a user creation form

I have to make a user creation wizard, there are 3 steps to achieve the insertion of a new user, so every step I have have a validation function to enable the next step. As a first step for the ...
-1
votes
2answers
63 views

Validation logic for range check with input can be String or Number

Requirement Validate two inputs (from and to). Input can be either Number or String (value hast to be date in UTC format) ...
1
vote
1answer
46 views

Methods to check form validity and to count invalid form fields

I have two these methods. Their loops are pretty similar. I'd like to refactor it to avoid duplicate nested loops. How could I do that? ...
1
vote
2answers
85 views

Validating username, password, and email in PHP

Let's pretend the following: ...
1
vote
2answers
64 views

Two classes to validate and store an e-mail address

I'm trying to improve my limited knowledge in PHP (7) and I wrote these two simple classes as a proof of concept. They both have just one (private) property ->email and they run validation before ...
5
votes
2answers
75 views

Prompting for a positive integer and validating user input in Java

I'm just starting out with Java, and trying to make a method to get a positive integer input from the console. My currently working implementation is this: ...
3
votes
1answer
138 views

Validating e-mail address input in C

I have this little function to validate e-mail. It's a little piece of code to search major mistakes in e-mail input and it's part of a bigger program I have to complete as a school assignment. Is ...
2
votes
1answer
34 views

Changing a user status flag, with validation

I am writing a function which on update of any attribute of model sets the status of variable is_kyc_verified to false. Here is the code of the User model and the ...
3
votes
3answers
84 views

PHP form validation for name, email, and Twitter handle

Given the following input values from a form, create a method or methods to validate the input based on their requirements. Throw an exception if any data is invalid. 1.1 ...
1
vote
0answers
53 views

WPF Track child collection validation errors

I have a need to get notified about validation errors that occur in a child collection of my ViewModel. For validation I use the ...
4
votes
4answers
194 views

Validating a tab-delimited string

This code checks if string has correct format for passing to struct. Correct format needs to be [123456789'\t'First Name'\t'Last Name'\t'City]. I didn't know how to ...
2
votes
1answer
35 views

Property validation

I require that the Feature set of my Licence to have a non-empty intersection with a set of features that the module I am loading contains. I expect other lists in my License to form similar ...
2
votes
2answers
32 views

Shipping address validations

In my journey of learning Rails, I'm wondering if I should test model validations. If so, is this a correct way to do it? ...
4
votes
2answers
790 views

Binary file validity in C++/C++11: checking a binary header

I have some code for checking a binary header to see if a binary file is meant to be read by a certain program, and I could use some extra eyes to review it. Assume the following ...
2
votes
1answer
65 views

Validating an arithmetic sequence

I'm looking for criticism on the following method used to determine if a collection of Integers forms an arithmetic sequence: ...
6
votes
4answers
241 views

Numeric integrity check

I'm a beginning C programmer. I need a function that will take a string and determine if it's a number. The data is coming from files created by different people and the number formats WILL vary. So ...
1
vote
2answers
37 views

File presence check for an automated workflow

I am working on a script for an automated workflow. It expects a CSV and a disk image to be present in the directory that is supplied as args.input. I want to check for and handle every possible ...
1
vote
2answers
73 views

Adding border to required fields when fields are empty

I want to add red borders to required fields, if the fields are empty. The ShowSelection() function is run when the interface is loaded, and everytime the interface is refreshed. I have the following ...
7
votes
2answers
68 views

Checking whether various form fields are filled in

This is a customer information data entry form. First name and Last name are required. In addition phone number, e-mail and birth date are used to check the database for existing customers with the ...
0
votes
1answer
61 views

Prompting for grades, with confirmation if a score higher than 100 is entered

This is an exercise from my computer programming class. This program reads in student scores from the user (input) and displays the total points earned along with a grade. I am tasked with modifying ...
3
votes
1answer
95 views

Validating a model that requires database access

Let's say I have this User model: ...
0
votes
0answers
20 views

Validate if time is valid including tests

So, I'm working on a method to validate if given time(s) are valid. In most cases, the input comes from the user. I'm not exactly sure on a few points: Readability Integrity Performance I'm also ...
0
votes
0answers
37 views

Fluent method arguments validation

I've put together a small fluent utility class for argument validation. Part of the code looks as follows: ...
1
vote
1answer
50 views

Validate a string for positive number and normal string

I have a method in which I am accepting a String clientid and that has below requirements: clientid can be a positive number ...
6
votes
2answers
164 views

Validating ISBNs

I'm just looking for a cleaner way. Obviously I could store a variable for some of the int parts. Personally, I think the one-liner looks better and everyone's ...
0
votes
1answer
68 views

Make a command line application with parameter

I made a command line application which uses parameters. So I try to make a system like the linux command. So I have 4 parameters, initialized to a default value, used if wrong or none parameter are ...
5
votes
1answer
123 views

NMEA 0183 checksum validation

I was hoping for a bit of advice on cleaning a couple of areas of this code up. In particular, the hex-to-binary section, the checksum is in hex, and the rest is in ASCII. I tried for a good day to do ...
5
votes
1answer
111 views

Is date 18+ years old?

Considering that: the passed parameters are all numbers the passed date is a valid date It should return: true if the date is 18 or more years old ...
1
vote
0answers
48 views

URL validation and data extraction

What do you think about this approach to validate and analyze URLs? There are Url and Url<TResource> model types to ...
3
votes
1answer
30 views

Classes for attributes validation

I have two classes responsible for attributes validation: ...
1
vote
0answers
42 views

PHP class's errors in different languages

I have a data validation class, which I would like to return errors in many languages. I'm not writing the whole class, just the needed parts as my question only refers to that. ...
38
votes
6answers
3k views

Accurate email syntax validation (no seriously)

So a friend happened to show me how odd and specific the general email syntax rules are. For instance, emails can have "comments". Basically you can put characters in parentheses that are just ...
4
votes
1answer
80 views

Validating a string for a positive number, null/empty string

I have a method in which I am accepting a String clientId and that has below requirements: clientId can be a positive number ...
-1
votes
2answers
74 views

Validating users with MySQL

One of my friends told me that my validate.php file has some problems with SQL injections. Please feel free to commit it on GitHub. ...
2
votes
1answer
93 views

Custom data validation approach for store items and prices

I came up with a validation design for my project and wanted to hear if there's anything I could improve. Here's how it works. I have the models (code first) ...
1
vote
4answers
80 views

JS form verification

I have three checboxes in my form. I have to check which one is checked and start the action. What do you think? Is this the easiest way of doing it? Checkbox 1 = cat Checkbox 2 = dog Checkbox 3 = ...
1
vote
1answer
47 views

Function to validate parameter and throw exception when invalid

I've asked a question receiving excessive (in a good sense) feedback. After I've incorporated it into the code, it changed substantially and I felt that I'd need opinion on the new version. Posting ...
0
votes
2answers
99 views

Function to validate a GUID, an EntityState, and some data

In the beginning of my methods that handle the calls from outside, I run this method to make sure that everything's OK, or let the caller know what's wrong: ...
2
votes
1answer
65 views

Hold and validate EAN code - follow-up

Based on suggestions and some thoughts I made some refactorings of my classes to hold EAN13 codes, I created a contract interface which now is extended by BarCode ...
4
votes
3answers
118 views

Hold and validate an EAN13 code

I've created a class that holds an EAN13 code. This class is an attribute of the Product class. In the Ean13 class, the ...
0
votes
1answer
61 views

Save user input in server-side database

I have created a site for practice and I have already asked a question on Stack Overflow about XSS. Someone tell me to show your php functions on this site that i created using ...