validation

What do I specify in my XSD to skip attribute validation for a xml tag.

Hello SO, My xml file is structures like below <outer> <inner name="nam" attribute1="abc" attribute2="def" /> </outer> Now, the only attribute I am assured of in the 'inner' tag is the 'name' attribute. Other than that I do not want to apply any restriction on the name or number of attributes the 'inner' tag can have. That would i...

ASP.Net MVC Client/Server validation

Im trying to use the example from this site to do client site validation. Im trying to use the html form tag instead of the "Html.BeginForm()" but doing that disables the client side validation. Does EnableClientValidation only work with Html.BeginForm. What is the difference? <%@ Page Language="C#" Inherits="ViewPage<ProductVi...

Rails - How to set a validation to occur in just one of my own controller methods

I have a password_reset_token field in my model and it just stores an authentication token which will be used to parse a reset password url. It's going to be nil unless the forgot_password method in my controller is called. It's here the token is generated. I want a validation to only run here otherwise every time I update a user obj...

Can I use a the value of a variable as the name of property in c#?

How do all! I want to be able to access a value in a class using the variable passed to a procedure. e.g. _results.projection[2].Current.FundDC to become something like _results.projection[2].termId.varName where termId can be Current, Future or Percent and varName can be a large list :) Any suggestions? Answers on a postcard plea...

Regression testing for schema (xsd) equivalence

Hi all, I am thinking about rewriting a schema with lots of standalone complex types in it, into one where the complex types extend other base types more sensibly. The rationale for this is partly conceptual - because most of these types are specific instances of a domain object with a definite hierarchical structure - and partly pract...

How do I use the ASP.NET MVC ValidationMessage HTML Helper inside my own custom helper?

Hi, I am trying to create a custom HTML Helper that encapsulates some presentation logic because I have to reuse this logic a few times on the same page and maybe in the future. If the user's address is in North America, then I want two text boxes to be displayed for the telephone number input, one for the area code and the other for t...

JQuery Validation with Select and Text Input

I'm having one heck of a time getting this validation to work. I'm using the JQuery Validation framework found here, and I'm trying to validate a form that has both a select and an input as required fields. I've managed to simplify the problem down to a rather simple prototype that demonstrates the problem: <%@ Page Language="C#" Au...

Validating C# base class constructor parameter

After running Code Analysis in VS2010 beta (FxCop for previous versions) I'm getting the following warning: In externally visible method 'Identity.Identity(WindowsIdentity)', validate parameter 'windowsIdentity' before using it. The constructor is: public Identity(WindowsIdentity windowsIdentity) : base(windowsIdent...

Struts 2's inbuit Validations on List items

<s:iterator value="listOfValues" status="row"> <s:textfield name="listOfVoObjects[${row.index}].itemId"/> <s:textfield name="listOfVoObjects[${row.index}].itemName"/> </s:iterator> In this scenario, does anybody know how to do validations on each itemId and itemName in the listOfValues when the form is submitted using the XML v...

Custom Validation

How are people doing their validations on data? Basically I have a requirement that to apply for insurance you need to be over 14 years of age. Now, on the application form you may need to not only enter your age but any nominated drivers date of births as well. I went through the Nerd Dinner example and it works but I was wondering...

SL3 dataform validation indicators don't show in tab pages

I have a Prism/SL3 application with a tab control and each page of the tab control is a "Region" that has its own view and viewModel. when I want to validate the main page, I call dataForm.ValidateItem(), then I go to all the child views and do the same. the problem is, only the pages which user has clicked on them (on the tab page), get...

A positive number from 1 to 2^31 -1 in regex

Hi, I got the following regex that almost does the work but does not exclude zero ...How to do that? ^(\d|\d{1,9}|1\d{1,9}|20\d{8}|213\d{7}|2146\d{6}|21473\d{5}|214747\d{4}|2147482\d{3}|21474835\d{2}|214748364[0-7])$ Also can anybody explain a bit how this works? ...

Programmatically adding validation control to asp.net page

Hello friends, I am trying to add a required fields validator programmatically in asp.net. But I get the following error message - Control 'req2' of type 'RequiredFieldValidator' must be placed inside a form tag with runat=server The c# code i have used is below - protected void Page_Load(object sender, EventArgs e) { Req...

What is wrong with this xsd?

The following XSD should validate that the favorite_fruit element's name attribute should only contain names of fruit in the fruits element. Here is the XSD: <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt; <xsd:complexType name="Fruit"> <xsd:attribute name="name" type="xsd:string"/> </xsd:complexType> <xsd:comp...

jquery validation rule for contains

is there way to create a rule in the jquery validiation plugin that allows you to say not contains "value"? ...

Check if ObservableCollection is valid

I have a WPF Dev Express DxGrid that is bound to an ObservableCollection in the following way. Private _FamilyList As New ObservableCollection(Of FamilyRecord) MyGrid.DataSource = _FamilyList When a user starts to enter information in the grid, I need to be able to check whether they have missed some information making it Invalid. So...

Form check with JS: select at least one checkbox and max 2 checkboxes

Hi, is there a way to validate a form through JS and check how many checkboxes are selected? I have a list with 15 checkboxes and I want that the user check exactly 2 checkboxes. ...

ASP.Net MVC Error Validation

I have an error validation issue with an int. I have validation for a customer name: if (String.IsNullOrEmpty(CustomerName)) yield return new RuleViolation("Customer Name Required", "CustomerName"); now if I want to add validation for a city, in this case I have a CityID that gets saved as type int, so I can't write my i...

Silverlight validation of dependent controls?

Hi All, I have Silverlight 3 application with two datepickers for Start Date and End Date. They are data bound to a business object which implements validation logic such that the StartDate must be before the EndDate and the EndDate must be after the StartDate. So far, so good - both controls display the appropriate validation error wh...

CakePHP model validation with array

I want to use CakePHP's core validation for lists in my model: var $validate = array( 'selectBox' => array( 'allowedChoice' => array( 'rule' => array('inList', $listToCheck), 'message' => 'Enter something in listToCheck.' ) ) ); However, the $listToCheck array is the same array that's used in the view, to populate a ...