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

learn more… | top users | synonyms

7
votes
3answers
123 views

Unicode Chess PvP with Move Validation

Main Purpose This script allows two players to play chess on a virtual chessboard printed on the screen by making use of the Unicode chess characters. Visual appearence ...
1
vote
1answer
57 views

Handling post-registration action

This code is Express NodeJS code that handles post registration .post action where the user must select a custom username. The username is validated, and if valid, ...
12
votes
5answers
768 views

Validating integer or string input

I'm at uni and working on an assignment in c# that takes some user input (from they keyboard via console). The input validation required: numbers must be within range (range will vary depending on ...
2
votes
2answers
41 views

Ensuring valid origin and destination countries

Having the following code in PHP 5.2, where: $row: Is an array that contains some things, but the ones that are interesting for the post are ...
5
votes
1answer
80 views

Validation extensions v2

I have still another version of my validation extensions. I've reworked it and added some new features. It doesn't relay on expression trees any more but as a compensation the same extensions can be ...
0
votes
1answer
33 views

Function to ensure that at least one choice is selected

First here is my settings object below. insight, spike and ...
3
votes
1answer
45 views

Constrained type alias

What do you think about the following syntax for some very simple and intensively reusable validations? Does this: string name = (SomeText)"Hm…"; mean for you ...
3
votes
1answer
62 views

Validation extensions

I've been working on another timesaver because I really really don't like to type all those validation ifs and exceptions over an over again. What I came up with ...
3
votes
2answers
63 views

Validating multiple parameters by regex and length

I have a set of validation functions which return a response code along with an error message if the validation fails. Requests can be of three types, and each of them contains a different type of ...
3
votes
4answers
46 views

Verifying that all form fields are filled in

I grabbed the form from some random site because I'm only interested writing the javascript at the moment. I am trying to check that a user has selected or entered text for all fields. I've made it a ...
5
votes
2answers
180 views

Express middleware to validate URL and tags

I am building an API where the client can send a url and some comma-delimited tags: ...
2
votes
1answer
81 views

Upload image with secure code

I have written [PHP code][ to upload image/s to server. (To see the result, open the JavaScript console of your browser, look at the Network tab or the Console tab.) The code is also available and ...
2
votes
1answer
69 views

Rails validating enum

The Ruby on Rails framework doesn't allow you to validate enums submitted through a form in any sane manner. Evidently, enums are meant to be used to maintain internal application state, and are not ...
2
votes
3answers
75 views

Text menu and validation of the chosen item

I am writing a c# 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 seems ...
3
votes
1answer
34 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
76 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
42 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
82 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 ...
5
votes
2answers
94 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
63 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
14 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
103 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
47 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
124 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
50 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
49 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
53 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
95 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
49 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
101 views

Validating username, password, and email in PHP

Let's pretend the following: ...
1
vote
2answers
67 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
87 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
146 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
37 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
101 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
81 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
198 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
36 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
50 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
793 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
68 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
245 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
43 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
81 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
98 views

Validating a model that requires database access

Let's say I have this User model: ...