validation

Simple Ruby Input Validation Library

I've been looking all over the place for a simple input validation library for Ruby. Everything seems to point towards ActiveRecord (or similar). I'm not using Rails, I'm using Sinatra without an ORM. What's the best approach for validating user input (without tying directly to the model layer)? Simple things like "string length", "is nu...

CSS Validator is saying my usage of text-wrap:suppress is invalid

I am using the W3C CSS Validator and it says that I have an error with the following code: Property text-wrap doesn't exist : suppress suppress .fieldLabelRed { padding:0px 2px 0px 2px; margin:0px 10px 0px 0px; color:#FF0000; text-wrap:suppress; <--- This line } I have looked at the CSS manual and this is what ...

RequiredFieldValidator works on dev and stage environments, not production

We deployed our legacy ASP.NET application to production after successful test deployments to our staging environment. The application makes use of RequiredFieldValidators on one particular registration page. On our development and stage environments, the validators successfully detect empty fields when "Submit" is clicked, error messa...

Changing which Rails Validations run depending on current user in deeply nested form.

I'm working with a nested form that encompasses a total of 7 models, each with different validations. When simply editing the form, the validations run and display fine, and data is saved properly. However, I need to have different validations run depending on who is submitting the form (ie, admins can skip some otherwise required fields...

What new validation attributes do we have in .net-4?

What new validation attributes do we have in .net-4? ...

Trouble validating data in Silverlight 4 RIA services

Hello, I have a Silverlight 4 RIA services project that I'm working on and I'm unable to validate a Child Windows text input. I have a text box such as this one: <TextBox Height="23" Name="txtSummary" Width="Auto" Grid.Row="2" Grid.Column="4" Text="{Binding DocumentView.Summary, Mode=TwoWay, ValidatesOnExceptions=True, NotifyOnValidati...

ASP.Net MVC 2 - jQuery Validation and Form Submit - DataAnnotations

I have a sample application, trying to learn jQuery validation and submit form in this scenerio. The page has one text box (EnvelopeID per class Envelope). If submit button is clicked and the text box is empty then i want to show an error message. If it is not empty then i want to post ajax request to GetData Action. The action returns...

KO3 - Kohana 3 - How can I pass $_POST data from a controller/action back to the view/form that called it?

Hey everyone, I am trying to validate a form submission in Kohana 3. I have the form::open point to my action_create in my controller which successfully validates the data posted to it from the form in my view. If the data passes validation, a new item is created as intended, and the user is redirected to the item that was just creat...

jquery Return Random Value from array.

So this should be a relativly easy thing for most people but I'm having trouble with it. I'm using the jquery validate plugin and would like to return a random vaule on success. Right now I'm trying to use. var success_message = new Array (); success_message[0] = "Good!"; success_message[1] = "Ok!"; success_message[2] = ...

Can this jQuery validation be refactored?

Hi Guys, I'm doing some simple client side validation with jQuery. var passedValidation = new Boolean(true); // Required Field Validators. if ($('#fbsignup input.firstName').val().trim() == '') { $('#fbsignup tr.firstName em').show(); passedValidation = false; } if ($('#fbsignup input.lastName').val().trim() == '') { $('#f...

java script validation

hello all, in my page there is an option to create new date field input box. User can create as many as possible date TO and Date From box as per his need. like, date_to1 || date_from1 date_to2 || date_from2 date_to3 || date_from3 date_to4 || date_from4 My problem is to validate all the date fields to check there is no clash in tho...

jquery validate conditional max

I have a form where there's an option group with the choice of entering a value in pounds or a percentage. Following this I have an input box for the actual value or the percentage. I want to use the validate functions in jquery to set a conditional maximum value (e.g.100) if the user chooses the percent option. Is this possible - I t...

Autowiring Validation without Naming Controllers After Models in Spring

Very new to spring and working my way through validation. I have examples working where I actually implement the spring Validator class, but am working on getting examples working without implementing the Validator class and instead using annotations directly on model class attributes such as @NotBlank and @Email. My question is this. ...

remove dynamic validation with Jquery Validate plugin

i have a simplified version of my problem here: http://www.arianhojat.com/temp/jquery/dynamic_validate/test.html Basically i had an email rule, and based on a checkbox i remove it... but it still isn't being removed... I tried moving it to its own rule with "add", then trying to remove via its accompanying "remove" function but still s...

Using gettext in CakePHP model validation

Hi! Is there any possibility to use the gettext functionallity within the CakePHP model validation array? Usually a programmer would do it like this: class Data extends AppModel { var $validate = array( 'title' => array( 'NichtLeer' => array( 'rule' => array('between', 4, 20), 'allowEmpty' => false, 'message' => _('B...

Validate JAXBElement in JPA/JAX-RS Web Service

I have a JAX-RS webservice (Jersey) that is a CRUD interface for JPA (EclipseLink) entities. My entities were autogenerated from the database tables and I have annotated them with JAXB annotations so that they can be marshalled/unmarshalled to/from XML. My resource methods take JAXBElement objects as a parameter where required. I don'...

How can I validate a model in MVC2?

I'm following the MVC2 NerdDinner tutorial and I can't make heads or tails of the model validation area. I have an Area class created by my .dbml. Then I created a partial Area class myself and added: partial void OnValidate(ChangeAction action) { if (!IsValid) throw new ApplicationException("Rule violations prevent saving"); }...

I need to validate data from multiple tables... how should i do it?

How should I validate data going into multiple tables that all depend on each other? I have a debate site, where users can start a debate and with their debate submit "survey options" so people can choose an option when they reply to the debate. The validation process goes like this, the debate model validates that the columns specifi...

ORM and validation

I want to implement an ORM and validation libraries for it. Please suggest me how start work. Or suggest any developed library from where I got any idea. ...

Simple Django validation with multiple parameters issue

Hi everyone, I've been playing with Django for a couple of days and stumbled upon the following issue. I have the following models: Employee = (id, employeeName) Project = (id, projectName) Assignment = (fk_employee, fk_project, from_date, to_date) What I want to do is to create a validator that won't allow assignment periods to overl...