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

learn more… | top users | synonyms

4
votes
3answers
71 views

32-bit factorial calculator in x86 NASM assembly

This program calculates the factorial of a given positive number. This is how it handles input: if negative, terminate program if 0-2, display input without calculating if greater than or equal to ...
3
votes
1answer
62 views

Possible to shorten my code of error displaying (if-statements)

Is it possible to shorten this piece of PHP code? Honestly, I think it does not look clean but like a mess. ...
4
votes
1answer
54 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
31 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: ...
5
votes
1answer
66 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: ...
3
votes
2answers
152 views

Simple structure that would contain validation errors messages

Before I go too far, does this look right? This is mostly to have a "central" place that hold a "hierarchical/structured" errors message. ...
12
votes
3answers
149 views

Credit card verification: string conversion most optimal?

Below is some code which verifies a credit card number using the checksum as well as check if number of digits are appropriate as well if digits start with right numbers. I am not sure if converting ...
12
votes
3answers
259 views

Celsius → Fahrenheit conversion table

It's harder to do than criticize. Here's my attempt to implement a Celsius-to-Fahrenheit conversion table in C++. ...
3
votes
1answer
47 views

Credit card validation with reversed array

I want a review of this code. ...
5
votes
2answers
92 views

iOS App - Interface for user log in using a call to a web service API

I have a navigation controller set up with a user code and password and a log in button. When the user clicks on the Log In button or the return key on the keyboard on the password text box - the ...
2
votes
1answer
57 views

Validating an entity using a dynamic list of predicates

I have a generic extension method for validating my entities. The main idea is to be able to specify at runtime (context related) the criteria for validating a specific entity (with the end goal of ...
5
votes
1answer
67 views

Date range validator

I have some code which works fine. First, it checks that dates format are valid and then, checks that first date is lower than second date. I had to use free input text and custom validator because ...
2
votes
2answers
57 views

Improving and shortening code for select validation

Is there any way to make that code shorter? I still want to use jQuery. I don't want to use any validation script. ...
2
votes
3answers
120 views

Reduce cyclomatic complexity

How can I reduce cyclomatic complexity of validation and refactor it better way? ...
6
votes
3answers
138 views

JS validation and submission with AJAX

I've got an assignment to do pure JS validation as well as submit with AJAX. Here is the code I've got so far. I'm wondering if I can do away with the whole "reason" bit. That was because it was ...
7
votes
4answers
1k views

Password checker in PHP

I have written a password checker using PHP, consisting of many if else statements. Is there any possible way to shorten this code? ...
5
votes
2answers
243 views

jQuery wrapper of Parsley.js

In a project, I have a lot of HTML forms without validation and I want to add a front end validation, in a quick way. I start looking for a library and I met Parsley.js. It's a good library, but if I ...
6
votes
1answer
483 views

Checking input and email field

I've written this as part of my contact form on my website. It checks to see if required inputs are empty, if so adds a red warning color and text. It also checks the email field for a properly ...
5
votes
1answer
125 views

Validating HTML Form

I am trying to create a simple validation for forms. I am almost there, but there are few bugs and optimization errors that I am really struggling with. I'm looking for advice on how to make this ...
6
votes
2answers
176 views

Spring password validator library

I recently got rejected at a job interview for submitting this: https://bitbucket.org/gnerr/password-validator The interviewer asked for a password validation library that was configurable via ...
6
votes
2answers
90 views

Simplifying this form validation script

Can anyone please help me to simplify this form validation script? It works great but I was just wondering if I can get some help to make it simpler. Your opinion on the approach I used below is ...
25
votes
5answers
2k views

Verifying password strength using JavaScript

I have a function which verifies the Password field and suggests the user to enter a strong password. I also have a label named ...
7
votes
3answers
180 views

Simple MPG calculator in Python

I am a self taught coder taking a Programming Fundamentals class to work towards a degree. It's based on Python, which I'm not as familiar with as other languages. I added error handling like I would ...
15
votes
5answers
1k views

Validating opening and closing bracket pairs

I have refactored one of my old homework assignments (mainly to utilize std::stack and some C++11), and I'm still having trouble making it less repetitive. It ...
3
votes
1answer
78 views

Reading and validating 2D matrix bar code

I need a review on this. This code will read a 2D matrix bar code, which I hard-coded as a string str. It has "]d" starting string, which is a GS1 International ...
8
votes
2answers
316 views

Checking if a string matches an array of valid characters

I am wondering what a better solution would be for this bit of code: ...
2
votes
1answer
53 views

A class for form data validation

I don't want any feedback on the regexes as I know what needs to be updated here. Also, don't need any feedback on naming conventions. I'm looking for feedback on the structure and correctness of ...
7
votes
2answers
150 views

Inputting and displaying strings

I have written some code for one of my assignments. However, I feel that I am repeating myself slightly in a few places. I have that niggling feeling that there is a better way to do things. Here ...
6
votes
2answers
139 views

Am I implementing BDD correctly?

I'm writing a utility that validates fields on a web site. I decided I'd give Behaviour Driven Development (BDD) a try. The validator utilises rules to determine if a value the user provided is valid. ...
3
votes
1answer
47 views

Class for file creation and directory validation

After reading some texts regarding creation of files under Python, I've decided to create this class which creates a new file on a directory, and creating a backup on the other directory if the file ...
1
vote
3answers
355 views

Validating email without Regex

I'm trying to improve my JavaScript (I'm usually a copy/paste guy but can do basic DOM stuff with jquery too), so I decided to try and make a function to validate an email address without using Regex. ...
0
votes
1answer
129 views

Rails validating with condition block

Rails AR. validate one field, with 4 validators & 2 condition block ...
1
vote
2answers
93 views

Making the code smaller and manageable

I'm trying to make my code easier to understand by making it more correct and maintainable. Here's the code I'm trying to simplify: ...
3
votes
2answers
168 views

JavaScript form validation: improve on 'good, but not good enough'

I recently received a 'good, but not good enough' rating on a coding exercise I was asked to perform. It was to validate that if "Product complaint" option was selected that Product name, Product ...
5
votes
6answers
231 views

Most efficient way to validate multiple textboxes against a tolerance value

I have a series of text boxes in a table to gather input as below: The user will input a target and actual value for each measurement point they require. I would then like to validate the actual ...
7
votes
4answers
365 views

Shorter way of prompting for a height of x feet y inches?

I'm currently working on a BMI calculator and just wondered if there was a shorter or more condensed version of doing the if validating statement. I have currently ...
3
votes
4answers
133 views

Dealing with non-required user input

I'm working on a page where a user can create new records, but not all values are required. When creating the SqlCommand with potentially null values, I'm wondering what's the best way, from a code ...
1
vote
2answers
225 views

Validating uploaded images

I have attempted to write a method that checks that images being uploaded are valid. ...
1
vote
2answers
67 views

Form validation for sporting events

I am coding a site where users submit sporting events. When submitting an event there are a lot of fields that need to be validated. This is the method I wrote to valid the fields: ...
1
vote
1answer
106 views

Simplify jQuery validation

I wrote a script for validate the input field for following requirements Not null Multiple of hundreds Less than needed amount Here is my script: ...
1
vote
0answers
265 views

Tiny MVC - Handling validation / sanitization in a model

I was told to post this here - original post. I'm fairly new to MVC concepts and PHP input validation. I'm open to all input, but I'm largely wanting to know if the following: Follows the MVC ...
0
votes
0answers
112 views

Model Input Sanitation / Validation - Is this acceptable?

I'm fairly new to MVC concepts and PHP input validation. I'm wanting to know if the following: Follows the MVC pattern correctly - if not, how can I improve it? Has any huge apparent security ...
0
votes
1answer
342 views

Form validation - security and input specification

So I'm working on a register form and I have four fields: name, username, email and password. I pick up the values of these fields in jQuery and depending on if all the fields are filled, I pass them ...
2
votes
1answer
126 views

Different types of model validation

So we have a RESTful webservice that implements CRUD operations for a model, like this one: ...
11
votes
8answers
1k views

Check whether address criteria contain only certain fields or more

I have a method that checks whether an addressCriteria contains only certain fields or more. If it contains more fields, it should return false, otherwise true. ...
1
vote
1answer
148 views

Would like help on improving my jQuery Validation code

Would like some assistance in improving my jQuery validation code. I have some repeated code, but I am not sure how to write it in a way so that I don't have to keep repeating the same code over and ...
2
votes
1answer
499 views

Is there a faster way to get ASP.Net Validation messages in a Page or UserControl?

Edit: The method call discussed is a public extension method in a shared library. I'd like it to be safe for others to call. A little background: I'm maintaining an ancient system written in ...
1
vote
1answer
77 views

Is this a solid basic form validation script?

Is this a good form validation script? I'm using jQuery. ...
0
votes
1answer
96 views

Validating Javascript Model

I'm looking to create a model in JavaScript. Here is an example of the code that I have so far: ...