validation

Rails validation for a has_many association

I am having trouble with validations on a has_many relationship where the children exist, but the parent doesn't. However, when creating/saving the parent object, I want to ensure that specific children (with certain attributes) have already been saved. There is a Parent object that has_many Child objects. The Child objects are persiste...

Asp.net Validators not Firing

I am doing some work on a legacy project, one that has been upgraded through the years from 1.1, to 2.0, and is now set at 3.5. Currently I am having some issues with required field validators not running when I click submit. It's a pretty simple setup. I have two textboxes, I need both to be filled when a user clicks submit, I have...

ASP.NET Pass Error Messages

This is probably going to end up as a stupid question, but countless research has offered me no results. I know there are different types of errors I want to check for, and when I should be throwing an exception for "exceptional" errors, and that I should create validating functions for input and other checks. My problem is, how do I...

Stop executing client side code if custom validator fails

Hello! I have a custom validator that validates input (date, double etc), i have other javascript code that runs on input.change(). If my custom validator fails i dont want the other javascript code to run (because input is invalid). For instance, i have code like this: $('input:text[id$=_nbAmount_txtNumber]').change(mainAmountChanged...

Verify/Check to see if a Configuration Profile has been installed on iPhone

Does anyone know if there's an API to check to see if a particular Configuration Profile has been installed on a iPhone OS device? Thanks, Cole ...

EntLib Validation problem on GetType(object) - expects string not object???

I have an Address object that I am trying to validate data against using EntLib: Given the following method: <ValidatorComposition(CompositionType.And, Ruleset:="FraudAnalysis")> _ <NotNullValidator(MessageTemplate:="Billing address is required.", Ruleset:="FraudAnalysis")> _ <TypeConversionValidator(GetType(Address), MessageTemplate:=...

django input element error css class

I'd like to know how can I add .error class to input elements (to registration app) when the form validation fails. ...

ASP.NET 3.5 UpdatePanel with Validation Control. Validation runs unexpectedly.

I've got a ASP.NET 3.5 sp1 site, and on one page I have two UpdatePanels. The first has a CustomValidator, and the second does not. I want the validation to run ONLY when the button is pressed. Currenlty, when the Gridview in the second updatepanel is edited, it also causes the validation. I've read a lot about how the validation control...

JQuery validation is not working for YUI editor. ASP.NET MVC

I'm using YUI(Yahoo UI) rich text editor control in my MVC view page. I need to do a jquery required field validation. It shows error message when submit without any value in that field but it stays after typing the value in the text editor. Please help me if anyone has tried it before or if you have any other javascript validation log...

Best way to do input validation when using Asp.Net Mvc 1.0, Json and jQuery Ajax

The title says it all really. I went through a few blogs/posts and there are some good solutions for input validations in Mvc 1.0, but most of them are about non-Ajax scenarios, so I was wondering what your preferred method is when using jQuery Ajax? Thanks. ...

NHibernate Validator One Value OR Another

Is it possible with NHibernate validators to get a validator that will validate one or other properties? In the example below either FirstName OR Surname is required. [OneOrOther("Group")] public string FirstName {get; set; } [OneOrOther("Group")] public string Surname {get; set; } ...

Validation - looking for certain combinations of values

I'm doing some validation where I need to check for certain combinations between two values. For example, if string1 is "fruit", valid values for string2 are "apple", "banana" and "pear". Currently, I'm doing this: switch(string1) { case "fruit": if(string2 != "apple" && string2 != "banana") { return false; } b...

RangeValidator Problem in ASP.NET

I was using RangeValidator to validate user input on client side for double values. One of my user said that when he enters 5E-10, my range validator does not understand that number as a valid double. What do you suggest me to do? Thanks, cas ...

how is this jquery app validating the username? (3rd party script)

The tutorial that I'm trying to figure out is this: http://www.position-absolute.com/articles/jquery-form-validator-because-form-validation-is-a-mess/ The username field looks like this: <input value="" class="validate[required,custom[noSpecialCaracters],length[0,20],ajax[ajaxUser]]" type="text" name="user" id="user" /> That <input> ...

Data validation for multiselect ListBoxes in Silverlight

I have a ListBox with SelectionMode set to Multiple. I'd like to add special data validation to the control so that if you select all of the items, the ListBox gets the red border and has a "You cannot select all of the items" error message. I was able to get it to work--but it's a hack. I'm hoping there's a cleaner way to do this. Here...

Validation for phone and mobile numbers.

Hi , I tried it on Google but not get proper RE.will someone help me to achieve this : Phone Number: (Country Code)-(City Code)-(Number) Mobile Number: (Country Code)-(Number) obviously that should not take char. Please help me ...

How do I sanitize string fields containing HTML at model level?

I have an app using Spring, JPA (Hibernate) and the Java validation framework (Hibernate Validator). I would like to be able to annotate fields in our domain model that are allowed to contain HTML and have them automatically sanitized at commit time. Anyone know a clever way to do this? I have tried using the validation framework but th...

asp.net validation control causing "random" error in javascript

I have an asp:FormView on a control (in an ascx file) which is loaded onto a portal page along with some other controls. I need to add validation to the form, but when I add any of the validation controls I get an apparently random error in the generated JavaScript when the page is loaded, and the validation doesn't fire when I need it ...

What is the best way to validate markup in a component-based web framework?

If you're using a component-based (aka Pull-based) web framework (e.g. Tapestry, Wicket, Struts et al), how do you determine that your markup passes W3C validation? Two approaches come to mind: Crawl the running app Pro: All the markup required for validation exists on the page. Cons: Can be very complicated to hit every page and...

Validating Telerik editable GridView row.

Hi, I'm using an Telerik RadGridView in a WPF application, which has two editable columns - Quantity and Cost. I have created a model for displaying this data in the grid. e.g :: [HasSelfValidation] class Item { public int Quantity{get;set;} public decimal Cost{get;set;} [SelfValidation] public void ValidateQu...