validation

Build and Include configurations with eclipse PDT

Im using eclipse PDT to develop a php project. There are several pieces of external code that we need to include (eg PHPExcel). Is there a way to set up my project so that i can get the auto suggestions from these classes etc whe typing the code but not get the list of validation problems and "todo"s that tey have? Perhaps i need to set ...

how to fire Validation on a property of a calss used by a HierarchicalDatatemplate instead of firing it on my viewModel properties?

Hello Everyone. the problem i have is somewhat difficult to explain i will try my best: i am using a custom control called "TasklItem" (derived from Panel). this control renders itself hierarchically in a treeview using following HierarchicalDataTemplate: <Grid Name="TaskItemTempl...

Custom Data Annotations IsValid is never invoked. (ASP.NET MVC 2 .NET 4)

I have a custom Data Validation Attribute I've created to make sure the passwords a user inputs are the same, but IsValid is never invoked. Custom attribute: public class IsSameAsAttribute : ValidationAttribute { public String TargetProperty { get; set; } private readonly object _typeId = new object(); public IsSameAsAtt...

How to maintain scroll position after client-side validation fails?

I've got an ASP.NET webform with asp:TextBox and asp:RequiredFieldValidator at the bottom of the page. If client side validation fails on form submit - the page scrolls all the way up. I'd like to maintain the scroll position on failed client-side validation. I've found this solution, but it seems overly complex. Any ideas? ...

cakePHP optional validation for file upload

How to make file uploading as optional with validation? The code below validates even if i didn't selected any file. I want to check the extension only if i selected the the file. If i am not selecting any file it should not return any validation error. class Catalog extends AppModel{ var $name = 'Catalog'; var $validate = array...

Enterprise Library Validation Block: Validating a nullable datetime

Hi, I'm trying to validate a nullable datetime using the Enterprise Library Validation Block without success. I've got a WinForm with a DateTimePicker with a visible checkbox. The DateTimePicker is bound to a nullable DateTime prooperty using a custom databinding where the parsing is done like this (if the DateTimePicker is not checked...

Validators Icefaces

I have validator classes in my application that display error messages in the ice:messages control but due to design issues I want to change the validation to only let the user insert the correct input. For Example if the user presses numbers in a text field that should take the name, it just won't let him type numbers. How can I possib...

Hitting enter in any textbox in chrome triggers the form submit, even when there is no submit button.

I am building a site which uses jQUery validation plugin and want things validated before submitting the form. My code looks like follows <form> <input type="button" value="Submit the Form" onclick="validateAndSubmit()" /> </form> <script language="javascript"> function validateAndSubmit(){ //do some validation and then submit ...

WPF Validation: Clearing all validation errors

Hi ! I have a WPF UserControl with many other controls inside of it. TextBoxes are among these. Every TextBox has its own validation: <TextBox> <TextBox.Text> <Binding Path="MyPath" StringFormat="{}{0:N}" NotifyOnValidationError="True"> <Binding.ValidationRules> <r:MyValidationRule ValidationTyp...

xsd validation using schematron

Hi, I'm trying to add schematron validation to my xsd. This is my new xsd : <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt; xmlns:sch="http://www.ascc.net/xml/schematron" elementFormDefault="qualified" &gt; <xs:element name="books"> <xs:complextype> <xs:sequence> ;P <xs:element name="book" type="bo...

Validate presence of nested attributes

How do I validate that a model has at least one associated model using nested attributes? This has been driving me crazy as I am sure that I am missing something simple. For example, I want to require that a List always has at least one Task. class List < ActiveRecord::Base has_many :tasks, :dependent => :destroy accepts_nested_at...

JQuery with Asp.net validation

I have a form that displays an asp.net grid with different people listed in the grid. A user can add new user's to the grid, by clicking an asp.net button on the page: <div id="content_button"> <asp:Button ID="btnAddperson" runat="server" CssClass="content_button" PostBackUrl="addperson.aspx" Text="Add Person" Tool...

Javascript: RegExp object creation problem

Hi I wish to use the following regex for validating a file-upload: /^(([a-zA-Z]:)|(\\{2}\w+)\$?)(\\(\w[\w ]*))+\.(ext)$/ But i want to be able to specify the ext filter. Is this right? function validateFile(str, ext) { alert(str); var expr = new RegExp("/^(([a-zA-Z]:)|(\\{2}\w+)\$?)(\\(\w[\w ]*))+\.(" + ext.toLowerCase() +...

How can I convert business layer exceptions into validation errors in SL4?

I'm fairly new to Silverlight and RIA. However, we're developing an app with a SL frontend using WCF/RIA to connect to our service layer. We're using the mvvm pattern so that may play into this as well. I have a particular dataform where I use commanding to hook the EditEnding event of the dataform. In EditEnding, I call my Service to...

validates_uniqueness_of...and unless...

What's the proper way to write? validates_uniqueness_of :a, :scope => [:b, :c], :unless => !d.nil? ...

Does using SQL parameter binding mean text can be directly entered from input?

As the title says, if I'm using SQL parameters, ie SQLCommand cmd = new SQLCommand("select * from users where username = @user and password = @pass limit 1", Cxn); cmd.Parameters.Add("@user", SqlDbType.VarChar): cmd.Parameters.Add("@pass", SqlDbType.VarChar): Can I just enter the parameters value as the direct entry from the input? ...

What is the model key for an Errors object in Spring MVC?

In my Spring MVC based web-app, I'm manually creating an Errors/BindingResult object after manually validating one of my domain objects. I can add my domain object into the Model by doing the obvious: model.addAttribute("myObject", myObject); After I do validation and have created an Errors/BindingResult object, under which key should...

localize default model validation in mvc 2

[Required] [DisplayName("my date")] public DateTime? DateReg { get; set; } so if the user is going to pass in an invalid datetime value he will get this message "The value '02.07.201022' is not valid for my date." how can I translate/localize this message ? ...

ASP.Net MVC 2.0 Client-Side Validation Posting Back

Hi All I have been trying this based on Scott Gu's blog: http://weblogs.asp.net/scottgu/archive/2010/01/15/asp-net-mvc-2-model-validation.aspx My problem is that although my scripts are running (checked in firebug) and I don't get any errors. My page is still going to the server. I have javascript enabled too ;) I have the following...

XML Validation - what rules-based engine or framework should I use

Hi, I need to come up with some kind of rules engine, where I can specify validation rules for specific xml files. Then the rules are read in and asserted against the xml. Whats the best way? Is it XPath, or XQuery, or XSL, or XSD even? Or maybe even XMLUnit? I'll need to do stuff like detect when certain attibutes are different from...