Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [validation]

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

5
votes
3answers
122 views

Chess move validator

I have written code for making a Chess Validator, which will validate the moves of a chess game. There is a Main class which is taking the input from the user, about the move. Problem Description ...
1
vote
0answers
18 views

jQuery plugin for allowing only digits to be entered in html form input

I wrote this small jQuery plugin to set some fields so that they allow only 0-9 digits to be entered. I intended to do that by preventing user from typing, pasting or dropping non-digit content. It ...
2
votes
0answers
41 views

Textbox validation component

My intention is to have a component that serves as a textbox wrapper and able to set the error state, error message, and allow the parent to pass a function that sets its local error as I did not see ...
1
vote
1answer
36 views

Using a form with formsets in Django

I'm learning Django and making my (technically second) project. The project features several apps, including player_interface and manager_interface. Here's the player_interface/models.py: ...
9
votes
7answers
1k views

Versatile string validation

I passed a technical test the other day, one part included a cheap string validation and I am wondering this can be further improved to be more versatile to requirement changes. The requirements were ...
2
votes
1answer
199 views

A Class to validate password strength

What would be the best approach to write this class. This class validates 3 types of passwords, Normal Medium Strong Github Link ...
2
votes
0answers
24 views

WordPress plugin for shipping calculation

I am writing a WordPress plugin that allows shipping calculation on the product page. Originally, shipping calculation is only available in the cart. To calculate shipping costs on product page, ...
3
votes
1answer
68 views

Simple fluent library to validate text content

Before I can perform a more or less complex mappings, treatments in business objects and saving results in databases, I often need to validate contents from flat text files or excel files All the ...
16
votes
2answers
825 views

Enforcing string validity with the C# type system

One of my biggest complaints about .NET is that there's no way to guarantee a string match a certain type in the type-system. Note This started as more of a proof-of-concept than a real usable ...
0
votes
1answer
58 views

Back end validation as front end validation

I am trying to use the back end validation for front end validation and this is what I got. Maybe there is a better way to do this? If someone knows please share the knowledge. HTML: ...
2
votes
2answers
32 views

Split all images over x amount of pages with $_GET

I would like to receive some feedback on the code I am currently using to display x amount of images on my website per ...
4
votes
1answer
26 views

Compare two strings in extended memory - classic 8052

I'm looking for a simpler code that isn't resource hungry that can compare two strings stored in different locations in the extended memory of a classic 8052 (namely the AT89S52 microcontroller) to ...
2
votes
2answers
68 views

Simple form validation in javascript

Used to use Laravel's easy to use form validation class, decided to mimic it in JS. I've been learning JS for 4 days now and decided to write my first piece of real code. I'm pretty sure its full of ...
2
votes
1answer
47 views

User form validation using a POPO

I'm trying to sketch out a stripped down generic form validation example. I started by creating Plain Old PHP Objects (referred as POPOs) for form input with some classes such as a validator and html ...
1
vote
1answer
47 views

A function to validate that an unbound form in Access has all required fields filled out

My goal in this code review is to see if i can figure out how to optimize the Validate function takes up fewer lines of code. i know there must be a way to cut it down so that it doesnt span 300 lines ...
1
vote
1answer
29 views

TypeScript 3 form validation object

Please, correct me with anything that I say in here (The actual question is below the code). I've been quickly prototyping a project (ASP.NET Core 2.1) and haven't found the need to structure it with ...
3
votes
1answer
98 views

Date input wrapper for TextBox

Purpose I managed to get completely nerd-sniped earlier today by a question over on SO and decided to take a stab at adapting my numeric input wrapper for TextBox...
3
votes
1answer
63 views

Temperature converter in Rust with input error handling

I started learning Rust a few hours ago with the Rust Book (2018 edition) and as part of one of the exercises decided to make a temperature converter. I wanted to make sure it handled all inputs ...
-2
votes
1answer
96 views

Simple calculator with validation [closed]

I've implemented a simple calculator in C# that takes in the left operand, the operator, and the right operand. Once the calculate button is clicked, I use four methods to validate the inputs: 1. The ...
0
votes
1answer
50 views

Assert LinkedHashMap element in jUnit test [closed]

So I have some test, maybe the given side of that test is not so important to catch the point of my confusion. I wrote ...
1
vote
0answers
37 views

Ruby - Create a bitmap editor that accepts user input to plot a matrix grid, points and lines

I recently didn't pass a take-home code test for a job interview - and one of the reasons for this was that the code was not as idiomatic as it could be. The premise is in the title - but below ...
2
votes
1answer
45 views

Check values in datatables, with validation rules that vary according to the data source

Background I receive dataframes from several sources (below I call these sources s1, s2 and ...
2
votes
1answer
48 views

Transactionally create something, if allowed

I have been looking over this block of code for hours trying to simplify it. Would there be a better way to check all those conditions before creating a transaction ...
1
vote
1answer
60 views

Check PHP validation code

I have made a form in HTML and the form data should be send via email. For that purpose I have created a PHP script. I did read a lot about the importance of form validation in order to prevent ...
2
votes
2answers
109 views

Validate Email as User is typing (JavaScript)

I have the following javascript function validateEmail(value). The goal of the function is to validate the users inputted email as they are typing. So if someone puts nfg@*gmail.com the email will be ...
1
vote
0answers
44 views

Business logic validation as custom Bean Validation annotations?

This is not my solution but that of an existing application I am enhancing. Basically what they are doing is annotating a Form.java with a custom validator that ...
2
votes
2answers
205 views

PHP login/signup validation class

I am working on a blog with PHP, specially in order to practice OOP. Since the blogging system will handle users, i thought that a Validation class would be a good idea in order to not repeat code ...
2
votes
1answer
438 views

Tkinter based calculator

I've recently finished building a calculator in Python using Tkinter, and would appreciate any and all feedback on it. Please ignore the use of the eval function, ...
1
vote
1answer
55 views

PHP validation class for username, email, and password

I'm relatively new to PHP OOP, currently I'm practising how to use it, however I am not really certain I'm building my classes correctly, I think perhaps I'm missing something out but I'm not entirely ...
3
votes
0answers
26 views

Use a pattern for fields validation

I need to validate the fields of user sent by an API. All works fine but the only one problem is that I don't like the solution is not an OOP solution. In the controller I call the service created by ...
1
vote
0answers
48 views

XML graphing, and attribute existence

I have been working on my own form of validation for XML other then xpath, as a toy project. First off, I use this class to add Validations to the graph to check for and validate they exist. ...
-1
votes
1answer
3k views

Password and confirm password validation in Android Studio

I just wrote this password and password confirmation validation code function that checks to see if a password is empty or not, and is it match (password = confirmPassword). I'm not sure this is the ...
19
votes
8answers
7k views

Program to check if a date is valid or not

I am a novice programmer and am currently learning Python programming by myself through a book. I stumbled upon a question in a chapter and it took me 2 days to figure out a solution for it. Although, ...
2
votes
1answer
29 views

Finding incorrect yml headers

Introduction I am working on a semi large project with a few hundred files. In this project there is a series of lesson.yml files I want to check is formatted correctly. And, yes, every file I want ...
3
votes
1answer
88 views

Convert string to double and check for errors

The following program converts a string to a double, and checks for errors. It uses the strtod() function to do the conversion, and follows the example given for ...
-1
votes
0answers
261 views

Candidate registration, with validation, using MVVM

I am new to MVVM. I Created Model class CandidateRegisterModel and ViewModel class CandidateRegisterViewModel ...
0
votes
2answers
49 views

jQuery function to display an alert when submitting blank fields

I am new to jquery and implemented following function in a js file in case of error- ...
2
votes
1answer
133 views

PHP contact form script

I have created a contact form that originally did not have any mechanism for sending out the email with whatever the user inputted in the fields. I have added it in here along with ReCaptcha check. I ...
5
votes
2answers
686 views

Apple receipt validator

I'm working on a solution for validating Apple receipts. Here's the repository as whole. I based it mostly on the gdx-pay-server library. In my implementation, one of the classes I want to improve is <...
1
vote
1answer
296 views

Form validation for multiple inputs

I created an example of a simple form for multiple inputs (name and phone number) in React. If the user enters invalid data in input field, error text is displayed near the same field. I learned a lot ...
2
votes
0answers
116 views

Form validation for the last name

I created an example of a simple form for a last name input in React, where I can check the validation of the data at the time of input. The last name should contain only small and capital letters. If ...
3
votes
4answers
95 views

Simplify form validation with function

In jQuery, I have been reluctant to create a better form validation, and I feel the time has come for me to do so. With that said, I have been using this particular type of form validation, and I ...
8
votes
2answers
305 views

Validating user-provided control points for a Bézier curve

I have made some code which will validate user input for getting 4 control points for a bezier curve. It works fine however I was just wondering If I could make this code any more compact or efficient?...
4
votes
1answer
70 views

Validator for vertices of a polygon

There is an object which has few properties. I wrote a function for test cases which check if the properties are satisfied or not. The function should throw an exception if the property is not ...
10
votes
4answers
493 views

Validator for mathematical expression in infix form

This program will validate whether a mathematical expression entered by the user is a valid expression based off whether the expression itself has been entered with the correct scope openers and scope ...
3
votes
2answers
76 views

Creating user accounts

I have a method which allows to create user account. It contains some conditions to control empty fields, wrong format of email, weak password, etc. ...
16
votes
6answers
6k views

Verifying IPv6 addresses

While trying to learn Python I stumbled upon a question which asks you to write a code that is able to take an input and verify it to see whether it meets the IPv6 Criteria. I wrote the following ...
5
votes
1answer
125 views

Basic input validation package in Lua

I'm very new to Lua (and programming in general). I wanted to start out with a simple package that validates input based on a set of rules. The code works as intended, but is what I have written is ...
2
votes
1answer
70 views

A basic form with React

I have been working of a basic from using React and I need your help to improve this part of my code, especially validate and ...
2
votes
1answer
101 views

Checking if all questions were answered with javascript

I made a quiz project and I made a code to see if all the questions were answered, using JavaScript. It works, but its way more exhaustive than I wanted it to be. I first check every single option ...