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
1answer
114 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: ...
0
votes
0answers
39 views

Form validation for password and confirm password JavaScript

I want to validate passwords for equality. I found this link, but I felt its very long JavaScript code, so I did some modifications to that code. Please review my code, if code quality is not good, ...
1
vote
1answer
14 views

Rails form helper to display email fields and their validation errors

I have a repeated pattern throughout my app that looks like this: ...
1
vote
3answers
54 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
51 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 ...
3
votes
2answers
54 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
28 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 ...
6
votes
1answer
59 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
68 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
63 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
29 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
59 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
44 views

Form validation for user account creation

What would be a cleaner way to write the following? ...
0
votes
1answer
30 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
40 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
44 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
49 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
37 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
28 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 ...
6
votes
2answers
59 views

Valid memory address in Python

I am looking for suggestions of improving this function to check whether a memory address is appropriate or not. ...
3
votes
1answer
49 views

Change password after being validated

I'm doing Python programming challenges and have come across one where the object of the challenge was to create a script to change passwords. The script must validate that the password contains, one ...
1
vote
1answer
56 views

Simple email validation script

I was doing a programming challenge and the object was to validate an email address, I wrote a simple little email validator and would like some input on how I can make it more efficient. How it ...
6
votes
3answers
638 views

Validating an IP address and returning the reason it's invalid

I have a method that validates a user-written IP address in an Android application. If it's invalid, I need to know why and notify the user using a Toast. I ...
1
vote
1answer
41 views

Using BigDecimal to validate epoch timestamp in exponential notation

I have some phone records in which epoch time is coming in exponential format like 1467.738871E9. I need to validate those records in which number is not in proper format and drop those records. Right ...
3
votes
2answers
71 views

Simple Input Text Analysis

I've started learning java. I've written a small program I've done in C before. It's simple input analysis. If there is number, program checks if number is prime. Then write number: (value of input ...
4
votes
2answers
100 views

Big Nerd Ranch Bronze Challenge: Disallow Alphabetic Characters

I just completed BNR's bronze challenge for disallowing alphabetic characters, and would love some feedback on what I did right and wrong, and how I can improve my code for reusability and ...
1
vote
3answers
66 views

Validator class for PHP

I've made this validation class in PHP that would take inputs, on initialization sanitize them and validate them specific to the type. It works fine, but I would like to know if there's some bad ...
3
votes
1answer
38 views

Profile creation

I was creating a view with Django that would create a user profile for a website and this is what I came up with: ...
1
vote
1answer
22 views

Preventing duplicate submission in Rails

I have a Rails app where doctors score patients on diagnosis - their score is the model Baseline. Each Baseline has a user id ...
4
votes
1answer
81 views

Javascript contact form validation code

I'm a UI / UX Designer trying to sharpen my JS skills. I wanted someone else to check this code snippet and maybe have a Pro tip to improve or shorten it. Javascript: ...
9
votes
6answers
1k views

Validation that also returns error messages

My Create, Update and Delete methods should return a ...
3
votes
0answers
30 views

Factory to augment JS classes with validation methods

I have some validation classes. To keep things smooth, I create a single class that has those validation classes inside of it. That class will be a singleton, and gets injected into my other classes. ...
5
votes
2answers
112 views

Age verification module in Python

I wrote an age verification module in Python 2.5 . How can I improve on current_year? import time perhaps? ...
1
vote
2answers
60 views

Simple JS validation for two contact forms

I'm not a pro in js so, my code is a mess (but it's working!). I would like to ask your help to reduce some redundancies in two cases. Those two are codes are affecting these two forms: ...
1
vote
3answers
61 views

JavaScript validation form

Could this code be improved? Would you suggest more sophisticated way of doing client-side signup validation? ...
1
vote
1answer
50 views

String length validation predicate

I partially refactored the code so okFields uses the extracted function checkStringLength. Now I also want problemFields() to ...
5
votes
3answers
184 views

ISBN validation with Hibernate Validator

I've written a ISBN-validating annotation. It is to be used in conjunction with Hibernate Validator. I'm pretty satisfied with this code as it works as expected, but I've had to make a design choice ...
3
votes
2answers
130 views

Form validation library

Background: After reading this thought provoking book I decided to write a small library as an exercise. ...
7
votes
3answers
151 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
65 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
856 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
44 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
101 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
40 views

Function to ensure that at least one choice is selected

First here is my settings object below. insight, spike and ...
3
votes
1answer
48 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
81 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
66 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
49 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
190 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: ...