Questions tagged [validation]

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

Filter by
Sorted by
Tagged with
4
votes
3answers
83 views

Validation on a form in JS

I've got a form that needs validating before the data in the form is added to a service queue: ...
1
vote
1answer
1k views

Is this a better way to validate a text box for mobile number only?

Is this a better way to validate a text box for mobile number only? Validation: allow only numbers will not allow to paste string including characters allow copy from the box length is set to 10 ...
17
votes
2answers
4k views

ISBN missing number solver

This is a programming contest question. Question as follows Problem Definition An ISBN (International Standard Book Number) is a ten digit code that uniquely identifies a book. The first 9 ...
6
votes
1answer
432 views

Using/storing server-side data on the client side

I've a slot booking script which is as follows: My Current Algorithm A calendar is shown to the user The user clicks on a date I make an ajax call to determine if at least 1 slot is booked on the ...
7
votes
2answers
18k views

Bank account number validation in IBAN format

I wrote a JavaScript function for validating bank account numbers in IBAN format for my own joy. Could you have a look if you don't see any obvious mistakes or places for improvement? ...
3
votes
2answers
3k views

Simple IPv4 and port validation for chat client

This is part of my chat client's code. It works fine but it looks messy. Any ideas? ...
12
votes
1answer
250 views

Bitcoin address validator in C

Here is a Bitcoin address validator I am looking to have reviewed in C. Normally I would have the enum and function prototypes declared in a header file, but I ...
3
votes
2answers
215 views

Determining if an entity exists in a database via a stored procedure

Here is a short and simple Ajax method that returns "True" or "False" if an entity exists in a database via a stored procedure ...
2
votes
2answers
2k views

Validate multiple regexes without a for loop in JavaScript

For a project, I need to validate a VAT number against the correct algorithm. I found a library for this here (freeware, so I should be able to reuse it) that I'm grateful exists. However, I feel like ...
7
votes
3answers
250 views

Refactor a selection validator

I have a data table and have to validate every field in it. I have refactor this code to this below, but the complexity is 15(!!) Should I make something like dictionary with ...
5
votes
3answers
1k views

Regex to validate font names

/((([\w -]+)|("[\w -]+"))( *, *)?)+/ http://refiddle.com/18ql I'm trying to use a PHP regex to sanitize a user input for a list of fonts. The above one seems to ...
2
votes
2answers
123 views

Generate the Norwegian equivalent to social security numbers - follow-up

First of, here is my previous post. That should explain a fair bit. The reason I'm posting one more time, is I have changed a lot. Using more classes, let them do all the work, and the overall ...
6
votes
3answers
527 views

Pattern tokenization program

I am writing this program to try and get some practice at C++ and correct and proper styling. This code is meant to take user input from a pip and then run it through the program. The user enters a ...
8
votes
3answers
16k views

Validation/error handling of user input values

This is a tiny learning program that lead to an interesting question: how can I best/most elegantly handle user entered numbers? This method works, fails cleanly, and reads well. It doesn't apply to ...
2
votes
1answer
145 views

Validation invoking queries?

I have a question regarding whether it is viable or deemed correct if a validation object invoked a query. Essentially, I have some code that looks like this: ...
3
votes
1answer
143 views

Can this date-validation function can be simplified further or is it the correct approach?

I am doing a date validation. I have no. of pages, which have the date field. User can input the date like "220875" or "22AUG75" - I need to test both and check the length as well. ...
5
votes
1answer
5k views

Multiple drop down validation

I have written some jQuery which validates a group of drop downs. It checks the text value selected in all the drop downs (first three characters), and if there is a duplicate, it warns the user. ...
4
votes
1answer
168 views

Additional model validation

...
2
votes
2answers
627 views

Validator extended to handle domain objects / entities

I started improving my validator library even more, and I think I'm at the last final element (domain object / entity validations) before I can gladly say that my Validator library is completely done ...
14
votes
7answers
42k views

Regex validation for Email Address

I need to validate whether my regex is correct for below scenario. Suggestion's if the regex is correct: Wiki Link Local_part The local-part of the email address may use any of these ASCII ...
11
votes
3answers
3k views

Bank card validation module

I hope that someone could review a module I wrote for bank card validation. I included a class that tests some of the methods, which is purely to show the methods work, rather than unit testing. ...
4
votes
3answers
1k views

Validating a string under few conditions

Following code validates NIC number of a person (National Identity Card, no like SSN) Requirements are... Length should be 10 digits or characters All should be digits except the last one Last one ...
2
votes
1answer
720 views

Using a single validation handler for all controllers in a form

In input validation I'm using this validation method in my all Forms. Here I have a single handler for all TextBoxes in my Form and if I have other controllers like ...
5
votes
6answers
118k views

Input validation for text boxes in a Form

In a Win Form I'm doing initial validation in the Form. So before saving data, I want to validate whether all the required fields are filled (Text Boxes) by the user. There are about 18 such Text ...
3
votes
1answer
330 views

Can this form validation be simplified made to memory leak free for all browsers?

I am doing a validation and I believe that there are many things that can be reduced or removed. I am still re-working this. But I am looking for some experts to look at my code and offer the very ...
3
votes
1answer
3k views

Checking if variable is defined before accessing its properties [closed]

I didn't write this but I noticed it in our codebase at work. ...
8
votes
5answers
727 views

Checking URL validity

This is sort of a follow up to a previous question (Do I have any SQL leaks?). I have changed some things around and am working on a solution where I use Active Directory to gather information about ...
2
votes
1answer
1k views

User name and password validation in a MVP application

In a WinForms application I'm doing the password validation as follows: When the user presses the OK button after entering username and password, an event will be fired and the listener in the ...
3
votes
1answer
1k views

Validating a model and focus to the element if validation fails

I am using Backbone Marionette - I would like to set the user name and password if that passes the model validation method. I am highly confused with that. Please show me a handy approach or correct ...
11
votes
2answers
3k views

A general purpose GUI data input, with validation, but unclear about best object design

When I'm throwing together prototype code, I don't want to spend extra time setting up parameters, or chasing down problems from entering parameters wrongly. So this is a general purpose, fairly easy ...
20
votes
2answers
1k views

Allowing users to input a safe subset of HTML

I am currently working on a project that requires users to input text that may or may not be formatted (if it helps, just think of it as a Stack Exchange clone, even though that's not quite accurate). ...
1
vote
2answers
2k views

Validate fields in Python dictionary using dictionary of lambdas

I would love some feedback on this. I use it to validate web-form objects before persisting them in the dangerously-lazy MongoDb. I have a class and many validators for each of my collections. Is ...
4
votes
3answers
395 views

Validating a date in a grid

This function checks if the EndDate of my grid is valid or not. If it is not valid, it turns the bgcolor of the cell to red color with ...
7
votes
3answers
427 views

Scrubbing user input

I'm taking user input from a file in form (1, 2, 3) to create a color, and I just wanted to know if I was taking most cases into account, and if there is any way I ...
11
votes
3answers
66k views

Validate and import data from an Excel file

I have recently designed a module which will do bulk upload for different contents. Basically the user will upload an Excel file, I will have to read and validate headers of excel then each value of ...
3
votes
2answers
181 views

Client-side validator for contact information form (name, phone, e-mail)

My recent post had some things to fix. I think this should be well structured and written for you. How does this code look to you? If something needs to be changed please tell me. ...
5
votes
2answers
539 views

Possible security issues in email validation

I need feedback on this code regarding security issues. ...
10
votes
6answers
2k views

Can people understand my form validation code?

I've just finished creating this form validation but I want to make it public for beginner 'contact us forms'. I was wondering if I can have some peoples' input on if they can understand/read my ...
5
votes
2answers
775 views

Password strength checker

I would like to receive feedback about my code. Is there any better way to shorten the code or is it fine? Demo ...
3
votes
1answer
7k views

ISBN Number Check

I’ve recently coded a way of checking a 10-digit ISBN. I was wondering if the code works to check the numbers, and if there are any flaws in my code. ...
4
votes
1answer
500 views

Form Validation Evaluation

I've been trying several styles of validation code for a form. I was wondering if this is good or needs some improvement or just trash it and use jQuery validator code? ...
7
votes
2answers
203 views

Test if string is numeric

I want to implement the following function: ...
5
votes
3answers
176 views

Matching square brackets

I wrote this program to match square brackets as part of a Brainf**k interpreter. I'm aware that it gets caught in an infinite loop if brackets are entered like this: ...
5
votes
3answers
4k views

32-bit factorial calculator in x86 NASM assembly

This is how it handles input: if negative, terminate program if 0-2, display input without calculating if greater than or equal to 3, calculate and display result I have also used some macros from ...
3
votes
1answer
91 views

Shortening if-statements of displaying errors

Is it possible to shorten this piece of PHP code? Honestly, I think it does not look clean but like a mess. ...
5
votes
2answers
344 views

Is there a better way to optimize these conditionals?

...
5
votes
1answer
2k views

Amalgamation of the repository and command / query pattern

I am coding a web based solution which consists of N number of tiers, these are: UI Web API Business The question I have is related to validation, repository and CRUD operations. I am adopting the ...
1
vote
1answer
126 views

Auto-Format GPA while typing : REVISED

I need to further simplify this solution to auto-format a text-box field intended only for the user to enter their college Grade Point Average (GPA). Here is my code: ...
14
votes
3answers
37k views

Sudoku Checker in Java

...
6
votes
1answer
897 views

Auto-Format GPA while typing

I'm looking for a more cleaner and simpler solution to auto-format a text-box field intended only for the user to enter their college Grade Point Average (GPA). Here is my code: ...