validation

Which validation framework to choose: Spring Validation or Validation Application Block (Enterprise LIbrary 4.0)?

I am trying to choose one of the validation frameworks for a major application, and while both options seem enticing, I was wondering whether there are any specific pros and cons I should be aware of before committing to one or the other. ...

Disable logging for struts2 validation

I want to disable logging for struts2 validation,whenever a struts action called containing validation I get 'junk' in my log, smth like this : "[Apr 15 14:42:41] ERROR (CommonsLogger.java:24) - Validation error for domain:blahblah.". I'm already using log4j and it's logging just fine but I don't want to this 'junk' filling my log. If ...

ASP.Net TextBox Validation

Hi, I have 2 textbox controls where date values will be entered. I want it so that if a date is entered into one of the textboxes then the other one becomes required. This is probably a real noobie question but any help would be greatly appreciated. Thanks in advance. Edit: Just to clarify a bit better. I use a compare validator to c...

Disable Save button in WPF if Validation fails

I've adopted what appears to be the standard way of validating textboxes in WPF using the IDataErrorInfo interface and styles as shown below. However, how can I disable the Save button when the page becomes invalid? Is this done somehow through triggers? Default Public ReadOnly Property Item(ByVal propertyName As String) As String Imple...

ASP.Net Validation not working when calling page via ajax

I have a page "MyPage.aspx" that calls "MyForm.aspx" with prototype new Ajax.Updater('display', '/myform.aspx' etc.... However, when the page renders there are no validation scripts on the page. ie, i don't see scripts like below when i call the page via ajax. If just call myForm.aspx i see the below scripts <script type="text/java...

Conditional validation in ActiveRecord

I need to do conditional validation of models in Rails dependant on one of the fields within the model. This is a follow-up to an earlier question which prompted development of a solution that doesn't feel right. I have a number of ActiveRecord models all based around an 'Order Model', a shortened version of which is shown below. clas...

Validating instances of inner-classes

Hi, I have a Java class B with an inner class C. Some methods of B accept an instance of C as parameter but I only want to accept C instances created by the proper instance of B. Is there a way to do this validation at compile time? Example C c1 = new C(); B foo = c1.getB(); // foo was created by instance c1 C c2 = new C(); c2.method...

Model validation and LINQ to SQL

I want to validate my linq2sql object differently based on its state (new object and updating an existing object.) An example is a User object that hash a Password byte[] field. This stores the hash of the password in the database. However, the user must type in PasswordText and PasswordText2 only if its a new user. I added two extra ...

struts2 validation

I have a text field and a selectbox (users can select multiple values by ctrl) in a form. I was reading validation provided by struts2: http://struts.apache.org/2.x/docs/validation.html However, it doesnt seem to have the validation I need. I want to make the text field a required field ONLY when certain strings are selected from t...

WinForm UI Validation

I need to implement input validation throughout my winform app. THere are many different forms where data can be entered and I would like to not have to go control by control by form and create isValid etc per item. How have others dealt with this? I see that most related posts deal with Web Apps and/or mention Enterprise Library Va...

How do I validate a string of XML against an XML Schema file

I'm developing a VB Web Application in .NET3.5 using Visual Studio 2008. I'm having difficulty in validating some XML as a string before I add it to a HTML form to post to a 3rd party. I have an XML schema file from the 3rd party to validate against and at this point I'd like the application to perform the validation before each post. ...

ASP.NET page validation

I have a requirement wherein I have a bunch of about 10 aspx pages.The user shall be able to go from one screen to another using navigation.All the range , custom,regex validators need to file so that data enetered is correct.Required fields need not be entered at this stage and the user can skip required fields. On the last page, I need...

disable some asp.net validation controls when a checkbox is checked

I'm using old fashioned ASP.NET validation (ugh) for a checkout process. I have a checkbox "I'll call with my credit card details". If checked I need to disable the required field validator and cc validator for the credit card number both on the client and on the postback. How do it do it? Thanks! ...

jQuery/JavaScript Date form validation

I am using the jQuery date picker calendar in a form. Once submitted the form passes params along via the url to a third party site. Everything works fine, except for one thing. If the value inserted into the date field by the datepicker calendar is subsequently deleted, or if the default date, that is in the form on page load, is delet...

In asp.net, I need to add validator to textbox that forces the input to be numbers

In asp.net, I need to add a validator to a textbox that forces the input to be numbers. Is this built in? I have already added a required field validator to the textbox. ...

On postback, how can I add a error message to validation summary?

Two questions: On postback when a user clicks submit, how can I add a error message to validation summary? Is it also possible to highlight a particular textbox using the built in .net validation controls? ...

Regex validator allowing empty as an input

Hi, Shouldn't this regex validator make sure the user enters something in the textbox? For some reason an empty textbox passes through. <asp:RegularExpressionValidator ID="revNumericValidator" runat="server" ValidationExpression="^\d+$" ControlToValidate="tb1" ErrorMessage="Please enter blah (must be a number)." />...

Problem validating against an XSD with Java5

I'm trying to validate an Atom feed with Java 5 (JRE 1.5.0 update 11). The code I have works without problem in Java 6, but fails when running in Java 5 with a org.xml.sax.SAXParseException: src-resolve: Cannot resolve the name 'xml:base' to a(n) 'attribute declaration' component. I think I remember reading something about the version...

asp.net mvc DataAnnotation Validation

Hi, i going to create some validation for custom object in my app. But i have some trouble when try to create CustomValidation rule. My object has field - BirthDay - which not required but if user enter it i need to validate it on simple validation, for example user DataType validation - DataType.DateTime. When i am try to do it i have v...

asp.net validation spacing is messed up with 2 validation controls on a textbox

asp.net validation spacing is messed up with 2 validation controls on a textbox. I tried playing with display static/dynamic but that didn't work. ideas? Update What is happening is this, if the 2nd validation control displays its message, the 1st validation is using up some white space as a placeholder for its message. So there is a...