validation

How do I validate that a list box is not empty (client side)

I'm working with ASP.NET 3.5. I have a list box that users must add items to (I've written the code for this). My requirement is that at least one item must be added to the listbox or they cannot submit the form. I have several other validators on the page and they all write to a ValidationSummary control. I would like this listbox valid...

Is there a difference between 'valid xml' and 'well formed xml'?

I wasnt aware of a difference, but a coworker says there is, although he can't back it up. What's the difference if any? ...

How do you perform address validation?

Is it even possible to perform address (physical, not e-mail) validation? It seems like the sheer number of address formats, even in the US alone, would make this a fairly difficult task. On the other hand, it seems like a task that would be necessary for several business requirements. ...

How would you easily validate a JSP option pick list?

I need to validate this simple pick list: <select name="<%= key %>"> <option value="ETC" SELECTED>Select an option...</option> <option value="ONE">Lorem ipsum</option> <option value="TWO">dolor sit amet</option> </select> So the user would never submit the form with the, excuse the repetition, "Select an option..." option ...

Is this a crazy way to handle multi Validation types with IDataError and WPF?

Hi We are using the standard method for our controls to report broken BO rules. This is done via the interface IDataError in our BO’s and in XAML the control is bound to the BO’s property etc. This approach works OK. But we need to show 2 types of visuals in the UI depending on the type (or category if you like) of the invalidation erro...

Can JQuery.Validate plugin prevent submission of an Ajax form

I am using the JQuery form plugin (http://malsup.com/jquery/form/) to handle the ajax submission of a form. I also have JQuery.Validate (http://docs.jquery.com/Plugins/Validation) plugged in for my client side validation. What I am seeing is that the validation fails when I expect it to however it does not stop the form from submitting....

Is there a standard framework for .NET parameter validation that uses attributes?

Is there a standard framework (maybe part of Enterprise Library... or .NET itself) that allows you to do common parameter validation in method attributes? ...

How can I set the ValidationGroup dynamically

Hi, I have a ASP.NET 2.0 webpage with 2 UserControls (.ascx). Each UserControl contains a bunch of validators. Placing a ValidationSummary on the page will display all validation errors, of both UserControl's. Placing a ValidationSummary in each UserControl will display all the errors of both controls twice. What I want is a Validatio...

ASP.NET: Unable to validate data.

What is the cause of this exception in ASP.NET? Obviously it is a viewstate exception, but I can't reproduce the error on the page that is throwing the exception (a simple two TextBox form with a button and navigation links). FWIW, I'm not running a web farm. Exception Error Message: Unable to validate data. Error Source: S...

Eclipse Ganymede not validating JSPs properly

I just installed Ganymede and am exploring an old project in it. All of my JSPs are giving me weird validation errors. I'm seeing stuff like - Syntax error on token "}", delete this token Syntax error on token "catch", Identifier expected Syntax error, insert "Finally" to complete TryStatement I'm doing best practice stuff here, no s...

Best way to validate user input JDBC?

Is there a built-in way to escape user input in java using the JDBC? Something similar to the php version mysql_real_escape() function. What's the best way to validate input? ...

Comprehensive server-side validation

I currently have a fairly robust server-side validation system in place, but I'm looking for some feedback to make sure I've covered all angles. Here is a brief outline of what I'm doing at the moment: Ensure the input is not empty, or is too long Escape query strings to prevent SQL injection Using regular expressions to reject invalid...

Is there a way to update VS' CSS validation to 3.0?

I'm getting warnings about CSS3.0 properties like text-overflow. Is there a way to validate against 3.0? ...

annotation based Spring bean validation

Hi, I'm investigating an annotation-based approach to validating Spring beans using spring modules. In this tutorial, the following bean (getters and setters omitted) is used as an example: public final class User { @NotBlank @Length(max = 80) private String name; @NotBlank @Email @Length(max = 80) private...

How do you write Valid XHTML 1.0 Strict code when you are using javascript to fill an element that requires a child?

I'm running my site through the W3C's validator trying to get it to validate as XHTML 1.0 Strict and I've gotten down to a particularly sticky (at least in my experience) validation error. I'm including certain badges from various services in the site that provide their own API and code for inclusion on an external site. These badges u...

Validation Block vs Nhibernate.Validator

I am looking for validation framework and while I am already using NHibernate I am thinking of using NHibernate.validator from contrib project however I also look at MS Validation Block which seem to be robust but i am not yet get into detail of each one yet so I wonder has anyone had step into these two frameworks and how is the experie...

What do you use for validation against XML schema?

When I want to validate my XML docuemnts against a schema in my server-side Java, I use the built-in JRE Xerces implementation and javax.xml.validation.Schema. It works fine, but when validation fails, Xerces gives error messages that are very close to useless, for example: cvc-minLength-valid: Value '' with length = '0' is not facet-v...

ZIP Code (US Postal Code) validation

I thought people would be working on little code projects together, but I don't see them, so here's an easy one: Code that validates a valid US Zip Code. I know there are ZIP code databases out there, but there are still uses, like web pages, quick validation, and also the fact that zip codes keep getting issued, so you might want to us...

JavaScript ClientSide vs. ServerSide Validation

Which is better to do client side or server side validation? In our situation we are using - jQuery and MVC. - jSon data to pass between our View and Controller. Alot of the validation I do is validating data as users enter it. For example I use the the keypress event to prevent letters in a text box, set a max number of character...

HTTP reponse splitting

Hi, im trying to handle this possible exploit and wondering what is the best way to do it? should i use apache's common-validator and create a list of known allowed symbols and use that? ...