validation

Python validation API

I'm looking for a Python (<3) validation API something like Java's Bean Validation or Spring validation. I'm not looking for a library that is limited to form validation, since I want to validate domain objects. Do you know a Python API for validating of domain objects? ...

Translating default form validation error messages in Symfony 1.4

Hi there! I want to translate the default form validation messages in symfony, like 'required' => 'my own text' Is there a way to do this? I searched in google, but haven't find anything useful. The XLIFF files are not working for me. :( OR Is there a way, to set default validation messages for like 'required' fields? e' ...

How can I check times to ensure they are in sequential order?

Hi, I've got a JSP page which allows users to enter time periods throughout a 24 hour period, they are stored as Strings from the request such as : 13:00 14:00 15:00 Whilst iterating through these values, I need to perform a check to make sure that the time in question is after the previous one, such as the above. I'm trying to av...

Rails: using validation for user register/login

I have a simple User class with the following validation of name uniqueness: class User < ActiveRecord::Base validates :name, :uniqueness => true, It works great when a new user is created. However, when I check the login form, the user enters his name, and the system says it's already taken which doesn't make any sense. So I impl...

[Need Suggest] The best validation library technic

I want to write a plugin to validate forms. I have made detailed research about that but I want to write it with my own way. I dont want to write so many lines of code when using the library. It should be easy to use. I found a jQuery library for validation. It uses HTML classes. For example if you want to a field with presence validat...

IE7 regex issue - Regex that work in every browser does not work in ie7

I have a regex validating a password value to be > 6 < 25 characters with at least one number. var passwordRegEx = /^(?=.*\d)(?=.*[a-zA-Z]).{6,25}$/; if(!#quickRegister_Password').val().test(pass)) { errorMgs += 'Your password must be at least 6 characters and have at least 1 number and 1 letter.\r\n'; } It works in Firefox, Chrome...

RIA service using CustomValidation and resource error message

How to put a resource (multiple languages in client) message into a CustomValidation? Example: using any of ValidationAttribute, let'say StringLength, I simple use ErrorMessageResourceName and ErrorMessageResourceType, but it did not work for CustomValidation. Simple Code: public class UserInfo { [Required] public string Name { get...

Validate AJAX generated form field.

I have a form with select Field A. This field can be dynamically populated based on the URL or it can be selected as usual. Once a value has been selected in Field A either way, select Field B is populated and exposed with JQuery AJAX. Here is the problem. If Field A is left untouched, and is dynamically populated by the URL, Field B w...

How do you validate multi-part models?

I'm working on a really big order form with a bunch of multi-part data that's submitted all at once. I'm using that trick where you render 30-40 item rows in the HTML and allow the user to "show" or "hide" more or less using jQuery. The problem is that while the user may have, say, three rows "showing" and they happen to fill all three ...

Drupal form validation functions

Is there anyway say Drupal to validate form elements like email fields, passwords, numeric fields validate automatically lets say bind a system validator $form['email] = array( '#title' => t('Email'), '#type' => 'textfield', '#validate_as' => array('email', ...), ... ); ...

[Spring framework Form Validation] disallowed field validation

Hi there I'm new with spring framework. I'm currently building some news manager form. Here a sample of my news entity : class News { @NotNull long id; @NotNull long idAuthor; @Size(max=255) String content; } As you can see, I use JSR303 annotation validation with Spring. I want to validate my "news edit form...

Spring 3 validation error

I'm trying to get some validators working with Spring 3. I keep getting an error: org.springframework.beans.NotReadablePropertyException: Invalid property 'name' of bean class [java.lang.String]: Bean property 'name' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the se...

How can I validate a radiobuttongroup in Android?

Hi! I have a radiobuttongroup in a game app in Android. Before the user can go on to the actual game he has to choose a level, which are three radiobuttons. Now, if the user clicks "play" the app crashes. How can I use a validation to see if a button was chosen? I have an edittext also, which I simply use a: if ((editText.getText().toSt...

Include the "minus-sign" into this regular expression, how?

I have this regex: var alphaExp = /^[a-zA-ZåäöÅÄÖ\s]+$/; This is for a name-field in a form validation. I need to make it possible to type names like this "Anna-nicole" (note the minus sign). Currently the minus sign causes error. I need to remake this regex so that a minus sign can be included in the name, preferrably make it so ...

How to check validity of Date String ?

In my project I need to check if a date string evaluates to a proper Date object. I've decided to allow yyyy-MM-dd, and Date formats [(year, month, date) and (year, month, date, hrs, min)]. How can I check if they're valid ? My code returns null for "1980-01-01" and some strange dates (like 3837.05.01) whon giving a string separated by c...

accepts_nested_attributes_for validation

I'm using Rails 2.3.8 and accepts_nested_attributes_for. I have a simple category object which uses awesome_nested_set to allow nested categories. For each category I would like a unique field called code. This would be unique for the category per level. Meaning parent categories will all have unique codes and sub categories will be ...

XML validation using Java Code

I need some code sample which shows how I can validate a xml file against a schema. Below is my XML document: <birthdate> <month>January</month> <day>21</day> <year>1983</year> </birthdate> The schema against which I want to validate the above XML is: <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt; <xs:import...

XML validation using Java Code

Possible Duplicate: XML validation using Java Code Hi, I need some code sample which shows how i can validate a xml file against a schema... Below is say my XML document.. "a.xml" <?xml version="1.0"?> <birthdate> <month>January</month> <day>21</day> <year>1983</year> </birthdate> Say the schema against which...

How can I validate the range 1-99 using a regex?

Hi, I need to validate some user input, to ensure a number entered is in the range of 1-99 inclusive. These must be whole (Integer) values Preceeding 0 is permitted, but optional Valid values 1 01 10 99 09 Invalid values 0 007 100 10.5 010 So far I have the following regex that I've worked out : ^0?([1-9][0-9])$ This allows a...

Spring MVC and JSR-303 hibernate conditional validation

I've a form I want to validate. It contains 2 Address variables. address1 has always to be validated, address2 has to be validated based on some conditions public class MyForm { String name; @Valid Address address1; Address address2; } public class Address { @NotEmpty private String street; } my controller aut...