Visual studio feeds

All Visual Studio blogs in one place

Subscribe

Enter your email address:

Delivered by FeedBurner

Increase your website traffic with Attracta.com

Google+

Contact

Email:
Subject:
Message:
Anti-spam: How many eyes has a typical person?

Follow us on FB

Search

Overriding Unobtrusive Client Side Validation Settings in ASP.NET MVC 3

AddThis Social Bookmark Button
    Introduction:

          By default, client side validation in ASP.NET MVC 3 leverages unobtrusive javascript and famous jQuery validation plugin. The jQuery validation plugin makes client side validation very straightforward. With this plugin, you have a lot of options to customize the client side validation. But unfortunately, ASP.NET MVC 3 internally initialize the jQuery validation plugin and does not provide you an option to customize the validation settings(options). In this article, I will show you how to customize(override) the jQuery validation settings(options).       Description:           Let's say you are creating an ASP.NET MVC 3 application with
unobtrusive client side validation. In this application, you need to override the default validation settings(options). Now, let's say you need to only validate the form fields when the form is submitted. You can make this possible by adding this script at the bottom of your page,   $(function() { var settngs = $.data($('form')[0], 'validator').settings; settngs.onkeyup = false; settngs.onfocusout = false; ...(Read whole news on source site)

Home : Blog List : Imran Baloch's Blog : Overriding Unobtrusive Client Side Validation Settings in ASP.NET MVC 3