Questions tagged [validation]
Validation is used to check data to make sure it fits whatever required specifications are set for it.
728
questions
0
votes
2
answers
77
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-
...
0
votes
1
answer
987
views
Inputs equality check using jQuery without plugins
I tried creating a function to check for a match between two email fields, let's say EMAIL and CONFIRM email. I absolutely try to avoid jQuery validate. It is not worth it for a single field. For the ...
0
votes
3
answers
91
views
Opening and validating an XML file
I have a section of code that repeats many lines and I am looking to refactor this code possibly so that a function can be used instead of the same lines of code each time. Below is the section of ...
0
votes
1
answer
385
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 ...
0
votes
1
answer
58
views
Function to ensure that at least one choice is selected
First here is my settings object below. insight, spike and ...
0
votes
2
answers
807
views
Validating input values in C#
I began studying C# 5.0 a few days ago and am trying to avoid duplicated code for validation of input values.
...
0
votes
1
answer
845
views
Save user input in server-side database
I have created a site for practice and I have already asked a question on Stack Overflow about XSS.
Someone tell me to show your php functions on this site that i created using ...
0
votes
1
answer
204
views
jQuery form validator
I am new to the world of jQuery plugins, I don't know why I didn't get into this sooner. What I have a working validator that validates bootstrap styled forms. What I have discovered is that the way ...
0
votes
1
answer
1k
views
jQuery .validate() plugin, additional method to validate numbers
A while ago I've written a custom validation method for .validate(). It is a local validation plugin, with some limited validation.
I was required to write a validation method with the following ...
0
votes
0
answers
132
views
Generic custom regular expression with dynamic pattern used as data annotation for Model
I want to apply custom regular expression as data annotation for all of my Model properties.
So I create a custom regular expression with dynamic pattern like below:-
Purpose:- So the purpose of ...
0
votes
0
answers
2k
views
Unit testing / TDD MediatR Queries and Validators
I would like to get a code review for the following code. It's meant to filter mocked products. I used to not like writing tests, but some time ago I realized how great TDD is. Not only it makes the ...
0
votes
1
answer
88
views
Prompting for grades, with confirmation if a score higher than 100 is entered
This is an exercise from my computer programming class. This program reads in student scores from the user (input) and displays the total points earned along with a grade. I am tasked with modifying ...
-1
votes
2
answers
146
views
Validating users with MySQL
One of my friends told me that my validate.php file has some problems with SQL injections. Please feel free to commit it on GitHub.
...
-1
votes
1
answer
166
views
Validation function using both for-loops and indexes at the same time [closed]
This function iterates through a open dialog box that has 4 values in it all optional except for aircraft1, aircraft2, warning_or_alert.
...
-1
votes
2
answers
4k
views
Validation logic for range check with input can be String or Number
Requirement
Validate two inputs (from and to). Input can be either Number or String (value hast to be date in UTC format)
"...
-1
votes
1
answer
33
views
Validation rules for payment cards in a data set
I have the following part of code. I dislike this, because if I need to add additional validation rule, I have to make changes in loop and create a varaible to store boolean result. For example check ...
-1
votes
1
answer
724
views
Javascript to PHP email validation? [closed]
So I'm working on an application where Javascript will first validate the email using a regex and then once sent to PHP, PHP will verify the user did not modify any of the javascript and validate the ...
-1
votes
1
answer
1k
views
Patten matching to check for non-empty argument list
I'm learning Elixir.
while building a trivial cli application (as seen here http://asquera.de/blog/2015-04-10/writing-a-commandline-app-in-elixir/) I'm defining a module that implements a ...
-1
votes
2
answers
178
views
Checking whether a comment contains text
Is this code good for checking if the variable texto is empty or not? How would it be done with try and catch?
...
-1
votes
1
answer
38
views
-1
votes
2
answers
130
views
Verifying that all fields of a unit has been suitably filled in
I have unit class which have some properties, and I have acceptancePolicy table which contain values. If values (from one row) are true method should return true. The method is below. How can I ...
-1
votes
2
answers
119
views
PHP Regex expression to validate a name input
As part of my validation I have the following regex expression:
...
-1
votes
1
answer
32
views
Model validation through the combination of PCA with classifiers
I use the code below for building machine learning algorithm.
In the end, I need to validate model performance.
However, I am confused if I do it correctly or not.
...
-2
votes
1
answer
73
views
Validate Search Binary Tree [closed]
I was looking to this exercise: Is Valid Binary Search Tree
I tried to do the exercise by myself without looking to the solution and my code is "much simpler" than the code I found at the ...
-2
votes
1
answer
808
views
An own approach to Angularjs validation
Introduction
So i am building a SPA with AngularJS. The application provides a large number of <input> elements and can be seen as a huge form.
However, i ...
-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 ...
-3
votes
2
answers
510
views
Which email detection regex is better? [closed]
Here I have 2 email validation regexps, which one is better and why?
...
-3
votes
2
answers
123
views
Check if a variable is one of a set of valid strings [closed]
We need to check if a given variable is either "get" or "post". If it's neither then I should throw an error.
My teammate and I ...