Questions tagged [validation]
Validation is used to check data to make sure it fits whatever required specifications are set for it.
51
questions with no upvoted or accepted answers
5
votes
0
answers
55
views
Form deserializer for Python Flask
I've started working on a small Flask project for no real reason other than fun, and pulled myself back on form validation. I realize that there are existing libraries like WTForms, but wanted to try ...
5
votes
0
answers
177
views
Winforms MVP Validation
I have a Winforms MVP application where I need to use the ErrorProvider on the view. I have added the following methods to my presenter to allow me to show the ErrorProvider but it just doesn't feel ...
4
votes
0
answers
173
views
Vuejs - input validation
I'm in a project that's currently using vue. I'm at the moment developing validations for the inputs and in a way to make them more flexible, my idea was to create an intermediate component "...
3
votes
0
answers
141
views
Validating a file input whose value is reset to empty string ("") after selection
My form comprises of a mandatory file input.
The form is validated according to the jQuery validate plugin.
The file input has attribute required so that the ...
3
votes
0
answers
655
views
WPF: An implementation of INotifyDataErrorInfo
An abstract base class which derives from the ObservableObject (MvvmLight), implementing the INotifyDataErrorInfo interface.
...
3
votes
0
answers
99
views
Validating Amazon CloudFormation templates using Rspec
I have created an open source project that uses Rspec to validate the formatting of AWS::CloudFormation::Init YAML blocks in CloudFormation templates.1
My project is here.
Some general concerns:
Is ...
3
votes
0
answers
43
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 ...
3
votes
0
answers
900
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
0
answers
423
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
0
answers
71
views
Initialising numerical properties from a text-based properties file
This is a Spring Framework-based datasource instantiator which reads its properties from the Spring Framework context, i.e. the values are initially all String from ...
3
votes
0
answers
52
views
JavaScript validator plugin
Please help me to improve the JavaScript validator plugin by making it more OO and robust.
Requirement is to trigger the validation if there is an attribute ...
3
votes
0
answers
726
views
Tiny MVC - Handling validation / sanitization in a model
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 pattern correctly - if not, how can I change it to ...
2
votes
0
answers
87
views
Sanitize input for a "robot on a grid" kata
I have the following piece of code which is FSI tested and works.
However, I want to trim it as much as possible (not only the comments, which are there for my own future reference) and make it as ...
2
votes
0
answers
49
views
Ensuring a valid JavaScript string in security-critical application
I'm writing an application where users can write custom expressions which are then converted to JavaScript functions and executed. The expressions are used for filtering and sorting data from a ...
2
votes
0
answers
179
views
jQuery validation for multi-page registration form
I use JS/JQuery validation for radioboxes, input field etc. Because of AJAX I use one global validation (in a separate file) and 4-5 other files to coverage actions in a relevant registration form ...
2
votes
0
answers
114
views
Pricing data checker script
I was recently given a task to implement a data-checker script which given an input file containing (date, last_price) values should check for 3 different kind of errors - missing values, stale values ...
2
votes
0
answers
425
views
WebAPI: Async Filtering CSV content + Json/XML Serialization
I am coding a csv file filtering api in ASP.NET Core, which takes a csv file located at a given uri (and retrieved via the query string) convert the content to a collection of records, then apply a ...
2
votes
0
answers
67
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 ...
2
votes
0
answers
39
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, ...
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.
...
2
votes
0
answers
666
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 ...
2
votes
0
answers
247
views
IE8 Form Validation
I am writing a custom form validation script compatible with IE8+. I just wanted to make sure I am not messing anything up. I have tested on IE8 its works. However, I want to make sure I am doing it ...
2
votes
0
answers
76
views
Expression validator service
I'm working on a project (in C++98) that uses a grammar validation service to validate mapping expressions for a small DSL. To simplify the project code, I've written a small interface for using the ...
2
votes
0
answers
451
views
Custom bang! method and Rails validation
I have a model called booking.
...
2
votes
0
answers
196
views
Angular validation function for a user creation form
I have to make a user creation wizard, there are 3 steps to achieve the insertion of a new user, so every step I have have a validation function to enable the next step.
As a first step for the ...
2
votes
0
answers
73
views
Checking a user registration form before sending
I think this isn't right way. Maybe you can suggest something about error-displaying in error-container which fill in JS.
index.html
...
2
votes
0
answers
575
views
Immediately send redirect response, preserving session data
This question is for Laravel 4 only, as the relevant parts are completely refactored in the upcoming Laravel 5.
I have written an helper function for validation, so I only have to put this in ...
1
vote
1
answer
59
views
Form Validation Code Optimization in HTML and JavaScript"
I've been working on a simple form validation code in JavaScript coupled with an HTML form. The form asks for user's basic information, including name, email, country, gender, and skills. There's a ...
1
vote
0
answers
102
views
Set-new-password form, including validation
I've got to make a form using Bootstrap and Angular, which validates the following requirements:
Old password, new password and confirm password are mandatory fields.
New password has to be equal ...
1
vote
0
answers
64
views
Check that inputs are valid dates
I have a method in a class that accepts either a datetime or string parameter. It is shown in the last code block (I didn't include the class). A little background is that I am defining a wrapper ...
1
vote
1
answer
58
views
Generic function accepting object and validators for this object's fields
I recently started TS.
I was looking for feedback on my below function (for example maybe it can be written in shorter way). Let's assume we still use the reduce ...
1
vote
0
answers
49
views
App that Builds a list of "targets" for a Text-Based RPG using the games' API
all!
I am developing a web "app" with JavaScript and jQuery with the help of a couple of other libraries for ease of use.
Its purpose is to collect user ID's and to build a list of "attackable" ...
1
vote
0
answers
198
views
Generics and aggregated evaluation of validation rules
I have a custom system for data validation; it handles anything from method parameters, return values, objects, etc. The core of this system is IValidationRule and ...
1
vote
0
answers
74
views
React.js hook to validate a form on submission
I am fooling around with hooks in React and I'm stumbling against decisions that I need to make regarding implementation. Below is the code for the custom useForm hook which can be used to hook up ...
1
vote
0
answers
71
views
Optimistic validation on tab change
I have a rather large UI for editing a user within a Angular application. It is split in multiple tabs and in order to reduce complexity the user cannot change the tab unless there is no validation ...
1
vote
0
answers
29
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 ...
1
vote
0
answers
122
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 ...
1
vote
0
answers
223
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 ...
1
vote
0
answers
117
views
JSON validator using rules
I'm writing an application that is meant to validate data. The data comes in the form of JSON and I'm using JSON Schema to validate the structure and some of the logic along with functions to ...
1
vote
0
answers
718
views
Using repository in a FormRequest in Laravel for custom business rule validation
This is my app/Http/Requests/Organisation/CreateOrganisationRequest.php
...
1
vote
0
answers
222
views
A rails controller needs to validate certain values exist
I need to pass some values from a CMS to a rails view. I should check these values are defined in the CMS. These values are meant to be use in all pages, hence the use of ...
1
vote
0
answers
122
views
Validating data
Some time back I asked for some code to be reviewed and I was advised to pull the data validation into its own class.
On a new class I decided to follow this advice. Before refactoring my code ...
1
vote
0
answers
2k
views
ValidationAttribute to validate a string against a JSON schema
This is my implementation of an .NET ValidationAttribute to validate a string against a JSON schema. The JSON schema file is stored within the application as an ...
1
vote
0
answers
106
views
Ajax Validation Handler
I'm trying to transition my app from a collection of server scripts to something that uses SOLID concepts.
I'm stuck trying to figure out a better way to do ajax validation.
I currently have a file ...
1
vote
0
answers
246
views
CodeIgniter MVC Controller to validate and save a form
I feel although my controller is over complicated and more should be moved to the model.
I've read that the controller shouldn't contain any logic, and just call the model/view, however it currently ...
1
vote
0
answers
3k
views
Spring MVC validation Multipart file in form
I need make validation of Multipart file in form class. I wrote custom annotation for form class which validate Multipart file. This code works great, but I don`t know if this is a good approach.
...
1
vote
0
answers
892
views
URL validation and data extraction
What do you think about this approach to validate and analyze URLs? There are Url and Url<TResource> model types to ...
1
vote
1
answer
49
views
Integer field in Python with extra constraints (Testable class)
I am trying to write an integer field in Python with the following attributes:
Minimum
Exclusive minimum
Maximum
Exclusive maximum
Multiple of
Value
Basically, given the constraints and the value, ...
0
votes
0
answers
99
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 ...