Questions tagged [validation]
Validation is used to check data to make sure it fits whatever required specifications are set for it.
727
questions
2
votes
0
answers
41
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
1
answer
239
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 ...
19
votes
2
answers
1k
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 system,...
1
vote
1
answer
111
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
2
answers
51
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
1
answer
53
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
2
answers
173
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
1
answer
92
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
1
answer
357
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 ...
2
votes
1
answer
105
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
1
answer
361
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...
4
votes
1
answer
133
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
1
answer
2k
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
1
answer
1k
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
...
2
votes
1
answer
204
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
1
answer
64
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
1
answer
98
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
2
answers
872
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 ...
2
votes
2
answers
1k
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 ...
3
votes
1
answer
1k
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
1
answer
482
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
0
answers
44
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 ...
2
votes
0
answers
64
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.
...
0
votes
1
answer
23k
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 ...
21
votes
8
answers
46k
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
1
answer
36
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
1
answer
2k
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 ...
0
votes
2
answers
80
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
1
answer
232
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
2
answers
2k
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
1
answer
3k
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 ...
3
votes
0
answers
903
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
4
answers
141
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
2
answers
348
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
1
answer
106
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
4
answers
3k
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
2
answers
1k
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.
...
17
votes
6
answers
14k
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
1
answer
1k
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
1
answer
105
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
1
answer
841
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 ...
2
votes
0
answers
680
views
CodeIgniter CRUD form validation
I've developed a crud "helper" of sorts. Fields/columns are derived from the database and contain everything from the name of the field to the type and size of the field. Part of the system integrates ...
8
votes
2
answers
2k
views
Checking some rules before a Telegram bot replies to a message
So far, I've created a couple of programs, and the issue that comes up is how ugly and non-scalable they look.
For example, currently I'm working on a telegram bot. Before replying to a message I ...
8
votes
2
answers
28k
views
Conditional validation on two input fields that depend on each other
My code consists of two input fields and a submit button. The business rules require the following rules:
At least one field must be filled out. Both can be filled out but both cannot be blank.
If ...
3
votes
1
answer
2k
views
Credit card validator code in Python
I wrote a Python code that is validating Credit Card Numbers. Some of the advanced programmers told me my whole code is messy. How can I make my code cleaner?
...
3
votes
0
answers
471
views
Define a class for latitude and longitude in C++ using boost::units and spheroidal coordinates
I am trying to write a class that defines latitude and longitude in C++ using boost::units and normalized spheroidal coordinates. I want to throw an exception if ...
3
votes
2
answers
2k
views
JSON Schema Validation helper method
This is what I wrote to validate JSON to the given schema.
...
3
votes
1
answer
112
views
Function to validate data using up to four kinds of rules
Sometimes I end up with a function that requires checking multiple conditions to determine the outcome and the logic can get to be too much to handle on a single line. Here's an example of how I ...
2
votes
1
answer
5k
views
Server side validation for reCAPTCHA V2 or Invisible reCAPTCHA with Java (Servlet)
The main reason for this post is that I spent quite a lot of time searching the easiest way to validate recaptcha V2. So I'm going to share my knowledge to avoid further time wastage of developers.
I'...
3
votes
1
answer
69
views
Ensure multiple steps work/saving multiple models via a service
I just thought of something new re: saving multiple objects in Rails (though Rails is not necessary).
Objectives:
Create an author and a tomato, but both of those must be valid.
If invalid creation, ...