xval

How to check if an element contains another element in jQuery

I am using xVal combind with the jquery.validate plugin, but have come across a slight problem in that it is posting validation messages twice in a certain instance. I think this bug should be fairly easily fixed with some clever jQuery in the placement of the error message. I am trying to find a way to see if a ul already contains an l...

xVal, DataAnnotations on the entire class.

I have a complete validation on an obeject and am trying to figure out the best way to handle it. Given the following class: public class LetterResponse { public Guid Id {get;set;} public bool SendBlankCart {get;set;} public string ToName {get;set;} public string ToAddress {get;set;} } I want to use a dataannotation and xval in o...

Data type validation with xVal

I'm trying to figure out the best way to validate data within a MVC C# app and xVal seemed to be the best fit. However I'm running into a problem with data type validation. At first I was doing an UpdateModel into the DTO and then running the validation on the DTO. This worked great for things like required fields, however UpdateModel...

xVal How do I validate child properties of complex types?

I'm using xVal in my ASP.NET MVC application, which is great in general. Following Steve Sanderson's blog post, I created a DataAnnotationsValidationRunner to do server-side validation of attributed objects. This works great for a simple class. e.g. Person: public static class DataAnnotationsValidationRunner { public static IEnume...

Disable button on submit with xVal MVC

Hi: I have an MVC app using xVal. I am trying to hook into the jquery validation to show a "loading" graphic once the form is valid. I cannot seem to find a way to only show the qraphic when jquery has validated the form. However, it also disables the button when the button is clicked and is NOT validated stopping the user from re-subm...

xVal vs ASP.Net MVC Validation toolkit?

Does anyone have any recommendations for either of these validation ASP.Net MVC Validation frameworks? xVal MVC Validator Toolkit ...

XVal, JQuery Validate, and Ajax oh my!

I'm using xVal with MVC and jquery validate. It all works nicely, until i get to my custom validator that does an ajax call. the ajax call returns the right value, according to the firbug Net Tab. But something is going wrong and I can't figure it out. Here's the javascript code: function CheckEmail() { var res; $.a...

xVal in MVC.NET with nHibernate.validator does not fire client validation

I have an ASP.NET MVC Project working with NHibernate and NHibernate.Validator and i'd like to use xVal 1.0 (most recent release). I Added the requested scripts to the project and referenced it in Site.Master: <script type="text/javascript" src="<%= ResolveUrl("~/Scripts/jquery-1.3.2.js")%>"></script> <script type="text/javascri...

[asp.net mvc] xVal Cliend side validation with ajax, RenderPartial form

Hi there I'm not sure if my issue is more general or only xVal specific. At the moment I have a form with an undefined list of partial forms Something like this. There I load a partial form with Ajax, with xVal I attach also a validator. My problem now is that the rendered form is not validated until a postback. Is there any possibil...

xVal to Force a field into error state

I have a jQuery autocomplete fild which gets existing data from my MVC action. I want to ensure that the data entered into the field DOES NOT already exist on the database. I had thisworkig using .result and .change on the autocomplete to set the field to class = "input-validation-error". When I added xVal client validation this still w...

How to add help prompt attributes to Business Objects in MVC and display in View

How can I provide some form of Attribute against my Business Objects in my ASP.Net MVC application so that I can pick up the help texts in the View and have them appear as pop-up hover help texts like this: <%= Html.TextBox("PostalCode", Model.PostalCode, new { title = "Please enter your postal code." })%> I want to be able to g...

What techniques are being used to pass MVC ModelState validation errors back to the client when using JsonResult?

I'm sort of thinking out loud here, so let me know if I need to clarify... on ajax heavy sites, when using JsonResult to pass information back to the client, what techniques, patterns, best practices are being used to pass ModelState validation errors back to the client? I am using xVal and castle validation on my view models, is there...

Using xVal and a ViewModel

I saw a similar post that was trying to do this same thing with the Dinner example, but he fixed his issue mine seems to be a little deeper. Basically I cxan get the validation to work just fine but it only works in Firefox. In IE7 when the page loads, I immediately get an alert box with the following message: "Error: Element title is no...

ASP.NET MVC Validation Framework when posting via jquery $.ajax?

Hello, There is a plenty of very good post and explanations how to implement validation with ASP.NET MVC, and I prefer one of these: xVal Validation with Service layer Data Annotation attributes However, I really like to call ActionMethods via jquery $.ajax method. One of the reasons why I want to use $.ajax is because there will be...

Which validation library for ASP.NET MVC?

Hi, I'm trying to decide what validation approach to take for a new ASP.NET MVC project. (And wow there are plenty of options!) The project uses NHibernate, so the first thing I considered was the NHibernate Validator (Because of tight integration with NHibernate). However, as far as I can see there are only a couple of benefits to th...

Xval and Tinymce

I have a problem on submitting an asp.net mvc form that is using Xval for validation and uses TinyMce as an editor on two text areas. The TinyMce editor is initialized with the new tinymce jquery plugin and the form validation and submission works perfectly if I remove the editor. But if I initialize the editor the form is submitte...

How to get Model errors in AjaxSubmit?

I am using AjaxSubmit to post a form and there are server side validations done using XVal (RuleException way). I am not using the try/catch way to add error to Model and then send to view. Instead - I want to use the HandleError attibute and in the OnException I am adding the errors to Model. The major problem is how do I get those erro...

how to append some error messages on xval validation summary through javascript in MVC?

how to append error messages on validation summary through javascript. i have added a validation summary, click on check button need to validate the credit card and retrieve the information back to the user, if the card is invalid i need to display that message in the validation summary. how can i do that? is there any way to programatic...

ASP.NET MVC - XVal clientside validation of dates

I'm having some problems with xVal's clientside validation when it comes to dates. I can't get it to work with a swedish date format which is yyyy-mm-dd, it only seems to work with mm/dd/yyyy. Is there a way to make it work with other date formats? ...

xVal & Nhibernate.Validation using external definitions

I am using NHibernate Validation with external definitions (that is not using attributes on classes, implementing validation by inheriting from ValidationDef<>) I am using the RulesProvider from here as I am using NHV 1.2 I am trying to get client side validation working in xVal. But because the validation does not come from the attrib...