xval

C# mvc2 client side form validation with xval, prevent post

I'm using xval to use client side validation in my asp.net mvc2 web-application. Despite the errors it's giving when I enter text in a numeric field, it still tries to post the form to the database. The incorrect values are being replaced by 0 and saved to the database. But instead it shouldn't even be possible to try and submit the form...

Using xval with fields containing periods

Hello, I have been using xVal with success for a while but this evening ran into an issue where a field containing a period would not be validated (client or server-side). I am using ASP.NET MVC2 and need to use the period syntax in cases where I am model binding to a list. In the below example I am using a textbox for the sake of simpl...

Regex match numerical range

I am trying to write a simple regex to match a percentage value range 1%-100% Is there a better way to write this? ^([1-9]|[1-9][0-9]|100)%$ ...

Using xval to client side validate forms

Hello, I am using ASP.NET MVC2 and to validate the forms i use xVal. It seems like the server side validation works fine, but the client side validation doesnt work or atleast doesn't show up. The code i use looks like this: <% using (Html.BeginForm()) {%> div class="label"><label for="EmailAddress">Email Address</label></div> ...

xval get message from resource file

I'm working on a CMS system which uses a resource file to get information and errormessages from. The client side validation is working without problems, only it's not getting the errormessage from the resource file. While debugging i figured out xval seems to get the errormessages from a javascript file where the messages are set hard-c...

asp.net mvc xval validation

Hi there I am using xval for the first time, it seems to work fine for required fields, However I am having some issues first of all it does not seem to validate booleans and also client validation is not working for me, this is not a major issue for me, the one that I really need to work is the stringlength property. It seems to do some...

How to conditionally disable client side validation in xVal?

I am using xVal in a ASP.NET MVC project. One of the forms has two buttons and i want to disable the client side validation when one of the buttons is clicked. Is there a way to conditionally disable client side validation in xVal? ...

mvc 2.0 xval Validation summary for two controls

I got small problem with validation summary : When I have two two control on page all summary validation information goes to first control validation summary element, even xval generated script say that elementID are different for summary. Any one know how to repair it? Here is link for sample project http://www.sendspace.com/file/m9g...

asp .net MVC 2.0 xval Validation element

I got one problem with showing error message to element. Is there any option to turn on messages on place where is Html.ValidationMessageFor(model => model.ConfirmPassword). Becsoue for me it isn’t show up. I would like to have summary and near field information too not only red border. Any one know how to do it? using (Ajax.BeginForm...

asp mvc 2.0 Partial View(ajax) and xval valdiation

Hi, I want to do some server side validation that is done on Action not in model (dataannatations). if(ok) //somecode else { ModelState.AddModelError("", "Some error"); } For that example I don't get any notification with validation summary. Even if I put property nam...

what would be the best method to override the validation of data in an mvc application

I have a very large form I need the user to complete. They need to be able to save their progress whether valid or not. When they have come back at a later time, they can update and make valid - then submit the data. I am using client side scripting (xval), server side attributes on the domain model. ...

Best practices for input validation in ASP.NET?

What is the common practice of input validation? In other words do you check for input validation on client-side, on server-side or on both sides? Also, if performance is crucial to me, would just the client-side input validation be sufficient for my website without presenting any security risks? ...

Using any type for MVC2 client side validation not just the Model

It seems that with MVC2 client side validation the type used to derive the validation rules from is fixed to the type of the Model of the View. I don't want to be bound to having the same ViewModel shape in and out. I want to take a message approach to action methods. With xVal you where give the option to specify the type used for c...

How to mark required field in jQuery Validate

Hi I'm using jQuery Validate and xVal to validate in input forms. This works great. However, I do want to mark my required fields with an asterix (*) or something like that to show which field is actually required. I could do this by hand, but since I already generate my validation rules with xVal I thought I could mark the required fi...

ASP.NET MVC 2 & xVal: Does Html.TextboxFor have a built-in ValidationMessage?

Hi, I'm using xVal for client-side validation, I have the following code: <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<Models.FiltersModel>" %> <%@ Import Namespace="xVal.Rules" %> <%@ Import Namespace="xVal.Html" %> <% using( Html.BeginForm() ) { %> <div id="filter-name-area"> <%: Html.LabelFor( x => x.Name )...

Problem with MVC2 Ajax form and xval client side validation.

Hi, I have loaded a prtial view in my MVC 2 application. The partial view is loaded via the jquery get method. The partial view contains the following code below. The problem I am having is that when the submit button is clicked the xval validation message appears but the form still gets posted. Has anyone any ideas how to stop the ...

xVal and ASP.Net MVC 2 AddModelStateErrors Problem

I have an application that I've been using xVal successfully on for quite some time. It was recently updated to MVC 2. I use the standard DataAnnotations attributes on my domain models, which also implement a "Validate()" method that calls the DataAnnotationsValidationRunner. If there are any errors, that method throws a RulesExceptio...

Cannot get xVal to work with CKEditor in ASP.NET MVC 2 app

I'm having some trouble getting the CKEditor html editor control to work with xVal. For the most part, xVal is working great for me. I am able to set up the remote validations with ease, and get them to execute on the client side. However, I recently added a CKEditor rich text editor textarea to my page and everything started to go pe...

Disabling xVal for Hidden Fields

In my MVC application, I've got a page where I use a few hidden fields to make some calculations under the hood. This page is loaded with xVal validations to make the data coherent. But the problem is that the xVal is also validating the hidden fields which are only used at the page itself. Is there any way of disabling xVal for hidden f...

MVC ClientSide date validation

I'm using xVal and jQuery for clientside form validation in MVC. A date field annotated with [DataType(DataType.Date, ErrorMessage=...)] is being properly validated if the user types a string that does not fit into the designated format. But if the user types something with invalid month or day, e.g., 13/32/2010, it is not validate unti...