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
3answers
43 views

Text menu and validation of the chosen item

I am writing a asp.net console app that will take a user input from a list of selected options and do things based on the selected option. I have it working right now but just looking over it there ...
2
votes
1answer
22 views

simple form validation

i've just started to learn python /django .. im coming from php world ...i mostly struggle with None values which are new to me .. in php i mostly did my boll checking with true/false but in python ...
2
votes
1answer
56 views

Validate a form using jQuery

I am validating a form using jQuery. It is working perfectly, but I just feel the code is quite "bulky". There is a lot of if statements being used to achieve ...
2
votes
3answers
41 views

Validating five date fields in Angular.js

So I have following piece of code which basically validates five date fields in angular service. But the catch is that there may be one to five field(s) visible on the screen based on some other ...
1
vote
1answer
80 views

Validating Email Addresses without DB

I wanted to put this out here and see if there were any security vulnerabilities that I'm not seeing. Also, if I can improve performance without sacrificing security, that's always a plus. Thanks in ...
1
vote
1answer
34 views

Checking whether a nonnegative number is present in a database [closed]

There is this function that checks if data is present in a database table. I am currently using try-catch instead of multiple ...
4
votes
2answers
83 views

Restrict HTML input field to decimal

I'd like to restrict user input in a form to a decimal with max two numbers before and 4 after decimal point. Valid values would be: 50 0.1 1.23 4.5678 12.943 ...
2
votes
1answer
35 views

Form validation in core php with oops concept

Here, i build one form validation script in php using understanding SOLID concept. My question is the way i coded my code is true way for ...
0
votes
0answers
13 views

Validating string lengths of link attributes

Here is a working typescript code: A modelValidator class that validates form user input. In this basic example it must check for length of form data submitted by user, and if one of the form field ...
1
vote
0answers
50 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
96 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. ...
2
votes
1answer
37 views
1
vote
1answer
28 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
107 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
46 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
48 views

Conditional async validation function

We have the following validation function: ...
2
votes
0answers
27 views

Custom bang! method and Rails validation

I have a model called booking. ...
1
vote
0answers
43 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
79 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
47 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
93 views

Validating username, password, and email in PHP

Let's pretend the following: ...
1
vote
2answers
66 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
76 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
142 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
36 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
89 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
69 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
196 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
41 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
243 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
41 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
74 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
69 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
96 views

Validating a model that requires database access

Let's say I have this User model: ...
0
votes
0answers
21 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
52 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
70 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
126 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
53 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
84 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 ...