Validation is used to check data to make sure it fits whatever required specifications are set for it.
11
votes
5answers
656 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
40 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 ...
4
votes
0answers
56 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
29 views
Function to ensure that at least one choice is selected
First here is my settings object below. insight, spike and ...
3
votes
1answer
44 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
60 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
62 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
44 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
179 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
78 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
3answers
74 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
32 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
70 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 ...
1
vote
1answer
35 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 ...
5
votes
2answers
91 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
55 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
101 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
43 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
48 views
2
votes
0answers
27 views
1
vote
0answers
51 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
89 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
98 views
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
81 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
145 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
97 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
78 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
197 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
46 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
66 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
244 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
79 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
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
38 views
Fluent method arguments validation
I've put together a small fluent utility class for argument validation. Part of the code looks as follows:
...