validation

Validating a number field on a PDF

Hello: I have a form and I need the user to input a number between 0 and 18. The idea is, when you put 18, the form warns you that you have to put also an additional number (from 01, 02, 03...98, 99, 00, 00 being 100). Let's say I put in 17. Nothing happens, it's all good. But when I put 18, the text field content must change to "18 /...

Extend complex types from an existing schema

I need to extend an existing XML document with new elements without losing the ability to validate it against both the unchanged original schema and an extended schema defined by me. For example, lets say I want to add Code and Price elements to an existing Book document, as follows: <aa:Book xmlns:aa="http://www.aa.com" xmlns...

How to disable Silverlight DataGrid validation footer?

I'm facing the following problem: I'm using validation summary popup for displaying errors on the page, and i have an editable DataGrid. So there are 2 problems: 1) DataGrid validation duplicates validation error, if it occurs in the DataGrid cell. For example. DataGrid contains a collection of objects IEnumerable. When I'm doing Comple...

Validator + MVC + REST::problems with update

Hi! I'm trying build my application using REST and Spring MVC. For some entities I have special page for update. After data submit it validated. If there are no errors it's redirecting to view of this entity otherway to edit page. haw I must pass data (entity and validator result) between controllers? here implementation with some ve...

File Upload Deny Animated GIFs (using PHP/Zend Framework)

i am thinking i may want users to be able to upload static GIFs but not animated ones. say for avatar's as they may look ... unprofessional and distracting. is there a way in PHP or Zend Framework that i can validate a file upload that way? ...

How to clear validation in ASP.NET?

Greetings, I use ASP.NET validation control and I want to reset them whenever the user click on a button "Create new stuff button as an example" and I don't want to set it to an empty error message. How can this be done in? ...

Sensible pattern for ValidationError class in C#

I am about to implement a class to represent a validation error. The class would definitely contain a string value called Message, which is a default message to display to a user. I also need a way to represent what the validation error is to the programmer. The idea is that there should be an easy way to determine if a particular valida...

spring 3 sub-bean validation

I try to validate via org.springframework.validation.Validator. My Problem: I have the a form-bean which has data beans. PlayerRegistrationDataBean -> has: PersonBean So how do I have to validate the PersonBean if I do not want to implement the validation everywhere I use PersonBeans as "sub-beans"? ...

Valid workaround for <style> tags inside of <body> to add custom CSS?

I know putting <style> tags inside of <body> is not valid. What other techniques are possible to get around this limitation? In my design I have a few static pages created with server side includes. For each page I need a few extra lines of CSS to control the display of a few DIVs. What is the best valid way to achieve this effect? ...

Phone number regex for multiple patterns in Java

I need help writing a regex for a phone number pattern that allows the following formats for a phone number 1)###-###-#### or 2)#-###-###-#### or 3)###-#### or 4)########## or 5)####### I am well aware, that you are able to find regex patterns on the internet, but I havent been able to find one that will pass for all these patter...

Rails on Ruby: Validating and changing a phone number

I have a simple phone form <%= f.text_field :phone %> right now. :phone is an integer type, so this requires that whatever the user enters into the form must be something like 5551234 instead of the more standard way of 555-1234 How can I allow the user to enter in a USA phone number like their accustomed to? I understand that I can use ...

Mysterious XHTML Validation Error

Hello guys, i am trying to validate homepage of my new website and looks like i have a mysterious trouble. If i use W3C Validator's copy-paste page source function, i only receive one warning and my page validates. However if i use link input to validate my page it displays following error: A fatal error occurred when attempting to de...

filter_var or custom function for email validation in php

Which solution is better, using the built in validation filter_var('email', FILTER_VALIDATE_EMAIL) or a custom function? Thanks! ...

How do I unit test ASP.NET MVC2 model validation?

I'm using Nunit as my unit testing framework and I've created a couple of L2S entities and validation classes. Now I want to unit test the validation, but I can't figure out how to do that. This is my validation class: [Bind(Exclude = "ProjectID")] public class ProjectValidation { [Required(ErrorMessageResourceType = typeof(Valid...

Validating Jpa Entities: In service or by lifecycle listeners

The question is where it is better (or in other words: where do you prefer) to put business validation logic of Jpa Entities. Two ideas are: In the EntityListener that before save or update would validate the entity In the service that provides access to jpa persisting methods. There are pros and cons of both. When using approach N...

Disable ValidateInput for a server control

Hello, I'm using ASP.NET 3.5. I have a page in which i want to display a list in a formatted way: <asp:RadioButtonList runat="server" ID="Options"> <asp:ListItem Text="Yes.<br /><span>Detailed info.</span>" /> <asp:ListItem Text="No.<br /><span>Detailed info.</span>" /> </asp:RadioButtonList> Now the somewhat obvious problem ...

Wordpress username availability with AJAX using Form-Validation-Engine

Well, my previous question brought me to use this script: http://www.position-absolute.com/articles/jquery-form-validator-because-form-validation-is-a-mess/ Because of my total lack of knowledge I don't understand how can I fit the "Inline AJAX validation" with the "ajax[ajaxUser]" class to work checking username availability when set...

How do I retrieve default validation messages from Hibernate Validator?

I'm trying to retrieve a default validation error-message using MessageSource. The code I'm working with uses reflection to retrieve the value of the message parameter. On a constraint that does not override the message parameter, I would like to retrieve the default error message. When I invoke the message method on the validation annot...

Form generation/validation libraries in Python

I'm a developer in Python coming from a PHP background. In PHP most frameworks included a decent form generation/validation API (Zend and CakePHP come to mind). At my new company we try to stay away from Django and use Werkzeug extensively. I've looked at FormEncode and Formular. Formular seems better to me, but there must be stuff...

How do I redirect into a new browser window after server side validation suceeds with javascript?

I have a form that needs to put its results into another window. I am using: It has both client and server side validation. The problem is when the server side validation fails, it puts the resulting error screen in the new window rather on the original page (as it should). What I'm trying to figure out is how to have the server sid...