Questions tagged [validation]

Tags for questions related to validating data.

Questions related to validating data. It could be data in a database, user input, messages from other processes, etc...

276 questions
11
votes
2 answers

Name validation best practices

I have a form and I was wondering about best practices when validating names (specifically throwing out characters which do not typically make up a name e.g. 123%^*$£ though theoretically could) and if it's sensible to carry out anything more than…
Suipaste
  • 241
  • 1
  • 2
  • 6
9
votes
4 answers

Is it a bad idea to do validation in the constructor?

Consider the following approach to validation of an API class (POJO or what have you, I mean a class which just acts as a container for some properties), we make all constructors private to the API scope (and actually let us insist there only be one…
5
votes
4 answers

Should validation messages contain punctuation?

When building an application should all validation messages have punctuation?
McPatrick
2
votes
2 answers

Where should tests and checks be implemented in a mathematical modelling process?

I have a mathematical model with two main "stages" 1. data loading (only a few KB of data) and 2. running a model on the data. I want to implement some tests and checks to ensure the data being fed into the model are valid (correct types, correct…
2
votes
3 answers

Property value validations on POCO entities

Sorry in advance if this question is so trivial. The situation There is a Customer entity whose ID is limited to two letters (A to Z) in the database. Also, a user can enter the ID value from a Windows form. I think that the best option is that…
HuorSwords
  • 155
  • 5
1
vote
0 answers

What's the right way to approach validations?

I'm a rails developer, and have noticed that while defining validations I find myself confused about the scope I'm trying to cover. For example, I have basic cases where a field of data (ex: name, email, etc) needs to be present, or the correct…
Nathan
  • 355
1
vote
3 answers

Textarea validation

I'm interested to hear what characters people permit in the various common fields of input forms (barring e-mail...) For example: Textarea/Messages: do you allow completely free text, or restrict to alphanumeric and punctuation? I've tried to go…
sunwukung
  • 2,275
0
votes
1 answer

Designing Validations Database driven configuration Vs hardcoding validations

So I am debating what approach to follow. My scenario is : Will receive a POJO which I need to validate ( REST end point ) Now I can explicitly validate specific fields ( which I know / are stated in requirements that they are mandatory ) OR…
akila
  • 187
0
votes
1 answer

How to work with fail reason

Imagine that I have a method like User::validate($data), and mostly the developer expects only that is returns a boolean (true mean "ok, validated with success"). But, in some specific cases, he need check why validation failed. What is the best way…
0
votes
4 answers

Should user input of a contact form be validated?

On software company websites I visit the first time, I often open the "Contact us" page and try to submit the contact form with all fields empty. I am just curios if they validate the user input. If it is just submitted or only validated poorly…
Uooo
  • 786
-2
votes
3 answers

How to handle submitted data - sanitization or validation or both?

As I was working on upgrading deprecated ereg_replace() statements in an e-cart sollution I was suddenly puzzled by questions regarding how to handle the submitted data I was working with. I was working with the add to card function, which from the…