validation

MVC Validation Error Messages not hardcoded in Attributes

I have a requirement that the validation error messages that are passed to my view come from the database. I want to use data annotation on my model but the error message key in validation attributes can only be a string or a constant. I'm open to other solutions for validation but I need to pull the error messages from the database. ...

Manually show validations on save with WPF datagrid

Using the WPF datagrid from WPFToolkit I want to show errors only during the save operation. Currently it seems to validate when you move off the row, hit enter, etc. There are two types of row level validations I need to perform: 1) Before service call to ensure fields on object are set. 2) After service call, to show any service va...

Custom formatting of validation errors & control tree issues - ASP.NET

Hi, I have a WebControl library I'm using to render out our stylized form elements. The library also contains some overriden validators, so that when used together, I can render out some nicer validation HTML/CSS than the default validator's red-star-next-to-a-field. Namely, I'd like to highlight the entire line. At its most basic leve...

Rails validation error with select tags

Hey Guys, Ive just set up some basic models using scaffold with Rails, i've edited the views so that im taking input from a textfield and a selection box. Here are some code snippets: form_for(@town) do |f| f.text_field :name . . f.select :county_id, @counties.map{|c| [c.name, c.id]} . . end Using the validation method "validates_...

Wpf - Nesting databinding and Validators

I am returning to WPF after a year of winforms development and am trying to get my eye back in with a small project. I am creating a simple 'Filename Textbox' which is a usercontrol with a textbox and a button ("...") which spawns the FileOpenDialog. On this usercontrol I have declared a dependency property of Filename which the Textbox...

DataAnnotations

public class Dinner { public string ID { get; set; } public string Title { get; set; } public Category Category { get; set; } public DateTime? DateCreated { get; set; } } Model view for that class (important part) is public class DinnerModelView { ... [UIHint("DatePicker")] ...

jquery validation only for visible controls

I am using jquery validation for required field vaidation. $("#registerform").validate(); This fires for the controls which are hidden too. For ex.: When the user selects Others option in How you find us? in register form, its required to fill the textbox for others option. But this fires even when the control is hidden. How to do ...

using JTidy with Maven2

I am working on a Java project using spring2 and Maven. I have already incorporated JSLint4Java into Maven, but now find myself needing to do some further validation. There are a number of core pages in the build i.e. home page, search page etc. that I want to automatically test the final HTML output for specification validity i.e. Val...

Page.Validate Null Reference Exception

Hello all. I have a bit of a problem I was wondering if you could help me. I have the following little bit of code: protected void btnSubmit_Click(object sender, EventArgs e) { Page.Validate("RadMaterial"); Page.Validate("TopX"); int max = 0; if (int.TryParse(txtbxHowMany.Text, out max)) { GridView1.Da...

ActiveRecord custom validation problem

Hi, I'm having a problem with validation in my RoR Model: def save self.accessed = Time.now.to_s self.modified = accessed validate_username super end def validate_username if User.find(:first, :select => :id, :conditions => ["userid = '#{self.userid}'"]) self.errors.add(:userid, "already exists") end end As you ca...

Collection exploration in validator interceptor

Hi all. A question about Java-Hibernate-Validator. I need to access to a collection attribute when my validation system intercepts an entity insert/update. I mean, my model defines A class with a set of B elements. When I call saveOrUpdate(a), the onSave/onFushDirty method of my interceptor is invoked. In that moment I need to know the...

Is it possible to avoid control validation after clicking one button and don't after clicking another?

I have a UserControl used for getting an exchange rate amount from user (bank manager) he prefer to be used by an account operation. Exchange rate can be loaded from central bank web service but just as a tip - final value is chosen by user. It contains one asp:TextBox box and two asp:LinkButton - Get (exchange rate) and Approve (client...

Where/How should I do validation and transformations on entities in Google App Engine?

In Ruby on Rails, each model entity has a "validate_on_*something*" hook method, that will be called before the entity is actually persisted to the database. I would like similar functionality in Google App Engine. I am aware that you can do validation on individual Properties by passing arguments to them in their declarations. However, ...

RoR plugin/gem for html validtion

I am wondering if there is such a plugin or gem for Ruby on Rails that includes HTML validation (SGML or Tidy) in a testing cycle. I am aware only about this plugin. Looking for alternatives... ...

Validating XHTML elements with XML children

G'day guys, I've tried reading the XML Modularization recommendation which promises to allow custom XHTML extensions but can't make heads nor tails from it. I need an XML document containing a mix of XHTML and user-defined XML elements to validate and having trouble doing so. Unfortunately I'm using an XSD and not a DTD, a la XSL which v...

Which MVC Validation Framework

Hi, I have been evaluating xVal as framework for validating Entities in the ASP.Net MVC Framework. I have recently discovered that each time a validation rule is broken, xVal cause an excpetion to be thrown. To me is seems incorrect. For example, when a user fills in a form, and forgets to fill three required fields , three exceptions w...

How can I place validating constraints on my method input parameters?

Here is the typical way of accomplishing this goal: public void myContractualMethod(final String x, final Set<String> y) { if ((x == null) || (x.isEmpty())) { throw new IllegalArgumentException("x cannot be null or empty"); } if (y == null) { throw new IllegalArgumentException("y cannot be null"); } /...

Problem with DataAnnotations and MVC1: Required attribute is ignoring the ErrorMessage property

I'm validating the properties of a linq to sql entity using DataAnnotations, the properties are validating fine but the Required[ErrorMessage="error message"] ErrorMessage attribute is being ignored and instead I'm getting the default error message. Here's the code I have so far: [DisplayName("Nombre")] [Required( ErrorMessage ...

Using Symfony's sfForm standalone, without the rest of the framework

I've seen some posts and questions regarding this: how can I use Symfony's sfForm as a standalone library? Just for managing a simple "hand-made" form but without the bulk of the framework. ...

How do you validate a page with AJAX content with a W3C service or similar.

I have a web page that is the parent to a bunch of pages that are loaded with in using the following code. function loadContent(elementSelector, sourceURL) { $(""+elementSelector+"").load("http://url.com/"+sourceURL+""); } To call this I would have a href like href="javascript:loadContent('#content','page.php')" How can you val...