validation

validating wsdl/schema using cxf

I am having a hard time getting cxf to validate an xml request that my service creates for a 3rd party. My project uses maven. Here is my project structure Main Module : + Sub-Module1 = Application + sub-Module2 = Interfaces In Interfaces, inside src/main/resources I have my wsdl and xsd. so, src/main/resources + myw...

WPF: Validating an object at submission

I am creating a WPF app using MVVM. The app manages tagged documents, called Notes, similar to blog posts. A Note has a Title, Text and a Tags collection. I want to validate a Note at the time it is submitted for two validation rules: The Title can't be empty; and The Note must have at least one Tag. If validation fails, then the Not...

How to not specify ruleset name when reading from config file?

When I read rules from a configuration file, I do something like this: IConfigurationSource configurationSource = new FileConfigurationSource("myvalidation.config"); var validator = ValidationFactory.CreateValidator<Salary>(configurationSource); The config file looks like this: <ruleset name="Default"> <properties> <property na...

Null Validation on EditText box in Alert Dialog - Android

Hi, I am trying to add some text validation to an edit text field located within an alert dialog box. It prompts a user to enter in a name. I want to add some validation so that if what they have entered is blank or null, it does not do anything apart from creating a Toast saying error. So far I have: AlertDialog.Builder alert =...

Validation (with custom ErrorTemplate) for a DataTemplate

I can't figure this guy out / in desperate need of assistance. I have an ItemsControl and a DataTemplate as the ItemTemplate i.e. <DataTemplate> <StackPanel> <TextBox Text={Binding Prop1}/> <TextBox Text={Binding Prop2}/> </StackPanel> </DataTemplate> I have seen plenty of examples for applying validation to th...

validation in php

i have a submit page in html. when i submit the form data, it goes to a php page, which inserts the data in the database. my question is how would i ensure that the data on the html page is not null or empty without using javascript? is there anyway this could be done in php? thanks! ...

validation using jquery

i'm trying to validate an html page using jquery, but nothing happens. it's a simple page, yet the textboxes aren't validated. this is the code: <link rel="stylesheet" type="text/css" href="style.css" /> <script type="text/javascript" src="~/jquery.js/"></script> <script type="text/javascript" src="~/jquery-validate/jquery.validate.j...

Help with password complexity regex

I'm using the following regex to validate password complexity: /^.*(?=.{6,12})(?=.*[0-9]{2})(?=.*[A-Z]{2})(?=.*[a-z]{2}).*$/ In a nutshell: 2 lowercase, 2 uppercase, 2 numbers, min length is 6 and max length is 12. It works perfectly, except for the maximum length, when I'm using a minimum length as well. For example: /^.*(?=.{6,})...

ASP.NET MVC does not add ModelError when invoking from unit test

I have a model item public class EntryInputModel { ... [Required(ErrorMessage = "Description is required.", AllowEmptyStrings = false)] public virtual string Description { get; set; } } and a controller action public ActionResult Add([Bind(Exclude = "Id")] EntryInputModel newEntry) { if (ModelState.IsValid) { ...

Accessing Microsoft Ajax validation object before sending jQuery Ajax call to server.

Hi, I've created a View which I do both server-side and client-side validation on the page using DataAnnotation attributes which decorate each input on the form. The validation take place when user tab out from a form control or when user clicks on "Submit" button which is of type "submit". <% Html.ValidationSummary("P...

php form-input validation

i have a html page in which i enter data which then submits and inserts in a database on a php page. how would i validate in php that the data received is not a duplicate of the data in the database? any help appreciated. ...

Jquery Validation Plugin - Require 2 checkboxes

I have a group of 12 checkboxes, all with the same name (name="4_RepPeriods"). I am using the Jquery validation plugin and i want the user to select no more or less than two of these check boxes. If possible I also want the other check boxes to become deactivated (unclickable) after two have been selected. I appreciate the help! Thanks...

ASP.NET MVC: Can I use the MicrosoftMvcValidation.js functions to make an <input type=file> mandatory?

I have a form with a file-upload button plus some other entry fields and a submit button. I want the submit button to be enabled only if a file has been selected. I could probably do this with JQuery, but I figured that since I'm already including the MicrosoftMvcValidation.js scripts there might be something in there that I could use? A...

Is it possible to have site wide default settings for all jQuery validation uses on my site?

I want to have site wide default settings for all jQuery validation uses on my site, I want every form to use the below settings, but then on a per form basis change the rules and messages. Is this possible? $('#myForm').validate({ errorClass: 'field-validation-error', errorElement: 'span', errorPlacement: function(error, elemen...

DDD: Client-side script to enforce invariants

Hello, One thing that I'm confused about in regards to DDD is that our domain is supposed to handle all business logic and enforce invariants. I have noticed some people (me included) handle certain invariants in the presentation layer (i.e. WebForms, Views, etc) with javascript. This is mainly done to improve performance so the server...

IDataErrorInfo: Validating when page submitted.

I am creating a WPF application that will use IDataErrorInfo data validation, which my business objects implement. I have been working with this demo from a blog post to understand ValidatesOnDataErrors. The demo is a trivial app that binds a couple of text boxes to a Contact object and implements IDataErrorInfo validation, using Valida...

Displaying form validation errors in a template (Symfony)

Hi, let's say I have a blog with a module "post". now I display a post like this: post/index?id=1 in the index-action i generate a new CommentForm and pass it as $this->form to the template and it is being displayed at the bottom of a post (it's just a textfield, nothing special). form action is set to "post/addcomment". How can I di...

MVC2 DataAnnotations with Server-side validation

Hi, How do you validate an entity containing DataAnnotations without using the MVC library? Using Model.IsValid is fine when you're within the Presentation layer, but what about when you want to ensure the model is valid in the Domain/Business layer? Do I need a separate validation framework, or is there an easy way I'm missing? Thank...

Possible to fire asp.net validation from jQuery?

I have a form with several text boxes on it. I only want to accept floats, but it is likely that users will enter a dollar sign. I'm using the following code to remove dollar signs and validate the content: jQuery: $("#<%= tb.ClientID %>").change(function() { var ctrl = $("#<%= tb.ClientID %>"); ...

Doctrine unsigned validation error storing created_at

Hi, I'm having problems with the Timestampable functionality in Doctrine 1.2.2. The error I get on trying to save() my Record is: Uncaught exception 'Doctrine_Validator_Exception' with message 'Validation failed in class XXX 1 field had validation error: * 1 validator failed on created_at (unsigned) ' in ... I've created the relev...