Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

Questions tagged [validation]

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

Filter by
Sorted by
Tagged with
2
votes
1answer
2k views

Is there a faster way to get ASP.Net Validation messages in a Page or UserControl?

Edit: The method call discussed is a public extension method in a shared library. I'd like it to be safe for others to call. A little background: I'm maintaining an ancient system written in ASP....
1
vote
1answer
139 views

Basic form validation script

Is this a good form validation script? ...
1
vote
1answer
154 views

Validating Javascript Model

I'm looking to create a model in JavaScript. Here is an example of the code that I have so far: ...
-2
votes
1answer
800 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 ...
1
vote
2answers
11k views

Form validation for zip codes

I have a function that I intend to use for validating zip codes and I wanted to know if my way could be made better. ...
3
votes
3answers
371 views

Exploitable holes in login script

This is my most recent login system I have been developing. It is working with Sessions. I want to know if I am doing well, if my code contains any serious exploits, and if my logic is correct. This ...
-1
votes
2answers
170 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? ...
3
votes
1answer
2k views

Contact form that goes to multiple addresses based on drop down selection

I followed a tutorial to create a PHP contact form that sends to multiple emails depending on drop down field selection. Is it protected from spam/other dangers? Or is it basically wide open for bots ...
2
votes
1answer
6k views

My login with AJAX and PHP

In your opinion, do I need to do all these validations? I thought to do well and stay safe but it seriously raises the question if it isn't slower. jQuery ...
3
votes
1answer
204 views

Contact information validation

The scripts below, I've obtained through tutorials and edited the best I know how. It all works - but I'd like to place them in one, external script. If at all possible, I'd appreciate some help in ...
1
vote
1answer
179 views

Refactor function that returns a comma Operator to pass jsHint

Some background This functions does some business logic before submitting a "add to cart" form HTML ...
2
votes
1answer
2k views

Properly storing error messages and displaying them with OOP

I have a class that I am using to initialize a form for editing. Once the form is submitted, data validation is done through the setters of my class. Good or bad input will be set in order to re-...
1
vote
3answers
889 views

Checking address fields for presence of a Post Office Box

I'm just trying to learn how to write jQuery better so I wanted some smart peoples opinions. The code is checking the billing and shipping address fields to see if it contains a PO Box address by ...
1
vote
1answer
1k views

Form validation script

I have a simple form validation script. Could you tell me how I can improve this script (mainly regarding security)? HTML page ...
1
vote
1answer
140 views

Verifying column and line counts

I have created this simple code: For the size of an array with 2 values (n and m), verify if ...
1
vote
0answers
166 views

Data model with validation in haskell couple convoluted functions

So I'm curious about a few things that I did here design wise, as well as one space I'm sure I can be given improvements from real haskellers. The part I really think can be done better that I'm ...
7
votes
2answers
911 views

MembershipProvider with Entity Framework and IoC

I am using Castle Windsor as my IoC container and I registered it as a DependencyResolver to let the MVC framework know about it. With the Entity Framework I have ...
4
votes
1answer
2k views

Custom jQuery validation error messages

We have a rule that all of our validation messages must be in a summary, and thus the default "this field is required" doesn't cut it because the messages lose their context in a summary and therefore ...
8
votes
1answer
7k views

Validating a credit card

I recently created an extension which detects the type of credit card based on the numbers entered in and formats it. I am using Luhn Algorithm for validating credit card numbers and I am using jQuery ...
3
votes
1answer
17k views

HTTP URL validating

What do you think about this? ...
4
votes
4answers
1k views

UPC-A validation

I've just written a validation routine for a UPC-A, which ensures the check digit matches the given UPC number (according to rules I found on Wikipedia). Below is the code, what do you think? ...
3
votes
1answer
798 views

Database, User and Validator in PHP

Please review my classes and give me some advice to improve them. I have also put some additional questions in the code and I hope you can give me an answer for some of them. Database.php ...
7
votes
3answers
8k views

PHP Validation Class

I'm looking for advice and ways on making it better. Code ...
3
votes
3answers
1k views

Validating the value of a property of an object

This code snippet is intended for validating the value of a property of an object. The min and max range is supplied as an .xml file like Nhibernate .hbm files. Since the data-type of the property is ...
2
votes
3answers
202 views

Checking mobile SIMs

Can someone improve this code? I need to eliminate the for loop. ...
2
votes
2answers
1k views

Simple form validation

I would really like to hear how I can improve my form validator. Next, I want to refactor it into OO and learn a testing framework like Jasmine. Some things I know I could improve: Don't make it ...
5
votes
2answers
433 views

Validating a password format

How should I make this more Ruby-like or just "better"? ...
5
votes
2answers
6k views

Validation and Form classes

I have written Validation and Form classes in PHP. Validation class allow you to define the ...
0
votes
1answer
386 views

jQuery login code

How can I improve this? jQuery ...
2
votes
1answer
2k views

GUI-based credit card checker

How can I make this more readable, faster, and make the GUI more appealing? CreditCard class: ...
1
vote
5answers
103 views

Solving an unwieldy inheritance framework function

I have a simple inheritance framework: ...
1
vote
2answers
465 views

User prompts for entering quiz questions

I have two methods here that does the same thing: get the user input and validate them. If they enter a letter, the program will prompt them again to enter a number. |After that, if it's a number it ...
8
votes
3answers
22k views

Validate IP address in Java

Following is the code that I'm currently using to validate the user given IP address (IPV4 and IPV6). It makes use of apache commons-validator's InetAddressValidator...
5
votes
2answers
264 views

Is this a good object oriented design for a file validator?

I'm working on a module that downloads a file saves it then validates if the file contents are valid. For simplicity lets assume that the file consists of 3 segments: Header, Body & Footer. Now ...
4
votes
1answer
815 views

Applying MVC to a validation application

I've been doing MVC for a few months now using the CodeIgniter framework in PHP but I still don't know if I'm really doing things right. What I currently do is: Model - this is where I put database ...
3
votes
1answer
419 views

Calling a Luhn check function when a credit card field changes

I feel like I should not be duplicating the code to gather the credit card number, but I am not sure how best to do it. Any suggestions? ...
2
votes
1answer
360 views

User data storage

I am writing my own website where users sign up. It then saves that data in an array. I want to know if this is effective or if there are better ways to do it. ...
1
vote
1answer
17k views

Form validation using AJAX with PHP fallback

I've used this PHP/AJAX method of validation for a bit, but I think it could use a little peer review. The basic idea was to create a way of verifying forms in a nice manor using AJAX, but also fall-...
12
votes
5answers
45k views

Checking whether a string is a valid number

I'm developing a Java Helper Library which has useful methods developers don't want to type out over and over. I'm trying to think of the best way of checking whether a string is a valid number. I've ...
16
votes
6answers
54k views

Is it better practice to have void method throw an exception or to have the method return a boolean?

This falls straight into the same category with the recent "Is it better practice to return if false or execute an if statement if true?" question. Often, while writing code, I find myself presented ...
1
vote
2answers
154 views

Validating required fields

I basically check for required input fields and if they fail to validate, I need to go to another level of output, check for other required fields, and so on... I can't get my head around this easy ...
2
votes
2answers
611 views

Validating booking information

After recently reading up on and watching videos on OO PHP programming I have decided to convert my existing site into OO to gain some experience. I have successfully (well, I think) converted a page ...
1
vote
1answer
2k views

Receiving an XML post and parsing

I need to receive an XML post then process all the data, and do whatever I need to do with the data. I could be receiving anywhere from 60 to 100 values. I know what all the elements are going to be, ...
2
votes
1answer
935 views

Validating a clustering document

My goal in the method is to write a simple clustering program that determines if a clustering document is valid based on these rules: All clusterings start with ...
4
votes
5answers
583 views

AJAX-based PHP server-side form validation

I am still a newbie at coding in general. Over the years the amount of programming that I have done in PHP has always been procedural. I am now working on a project for my course, and was hoping to ...
1
vote
1answer
200 views

Validate several validation groups

I have 2 validation groups, VG1 and VG2. I have a button BtnInsert that saves data into Datasource. Its Validation Group is VG2....
5
votes
3answers
4k views

Validating password rules

The following method is designed to return true if it passes all of the rules for a password. Does anyone see a way to improve it? Performance improvements are ...
5
votes
2answers
106 views

Validating a user

This works well, but can anybody see any faults in this code? If so, could you suggest ways in which I can fix it? ...
2
votes
1answer
2k views

Validation of Time

I am trying to validate time entry. ArrTime is the time entered by the user from the UI. I am trying to make it so that when a user attempts to add a time, it must ...
5
votes
2answers
1k views

Simple form validation script

This is a simple form validation script. I'd like to: improve the jQuery validation simplify the jQuery code Questions: Should I be exporting pure JS validation to avoid potential conflicts with ...