Questions tagged [unobtrusive-validation]

Unobtrusive Validation refers to a jQuery plugin created by Microsoft used in conjunction with the jQuery Validate plugin. It is shipped with ASP.NET MVC 3.

Unobtrusive Validation is a jQuery plugin written by Microsoft that acts as a support library for jQuery and the jQuery Validate plugin.

The script is shipped as part of ASP.NET MVC 3 and is included in new Visual Studio 2010 MVC 3 projects by default. It uses HTML5 data attributes (data-val-*) usually originating from DataAnnotation attributes on the view's model.

1239 questions
-1
votes
1 answer

Custom Unobtrusive Validation Method Not Firing as Per Documentation

I've been attempting to implement a ASP.NET MVC custom validation method. Tutorials I've used such as codeproject explain that you add data-val-customname to the element. Then jQuery.validate.unobtrusive.js then uses the third segment of the…
-1
votes
1 answer

Jquery Unobstrusive validation show errors manually for Valid

I have added errors manually to my input using the link in here Here and the example in Here but when I try $("#myshowErrors").valid() after I added the errors it becomes true? here is my code var validator = $( "#myshowErrors"…
Helen Araya
  • 1,886
  • 3
  • 28
  • 54
-1
votes
1 answer

How to prevent immediate trigger jQuery validation?

There is some ViewModel: class MyViewModel { [Required(ErrorMessage = "Field {0} is required")] public string Email { get; set; } } I use jquery validation for front-end:
Ilya Loskutov
  • 1,967
  • 2
  • 20
  • 34
-1
votes
1 answer

How correctally validate DateTime in MVC Unobtrusive Validation?

Im triying to validade a datetime field with inobstrusive validation. If the input is 01/01/2017 10:00 then I get The field [fieldId] must be a date. However the field must not be a date, but a datetime. The parameter is set like this in my…
Daniel Santos
  • 14,328
  • 21
  • 91
  • 174
-1
votes
1 answer

MVC - validation : if the list contains one element - then it's not required; if it has more - then they are all required

I've got a view from EditApplicationConcessionModel view model This View Model along with it's other properties has a property ListAnexes public List ListAnexes { get; set; } here is theAnexes class public class Anexes { …
Tania Marinova
  • 1,788
  • 8
  • 39
  • 67
-1
votes
1 answer

How to disable jquery.unobstrusive and enable jquery.validate in MVC forms

I have a MVC form and i am using JQuery.Validate.js plugin to validate all my controls. Now i had a requirement of making the form to submit the value Asynchronously, so i took advantage of Ajax.BeginForm() and i had to also include…
-1
votes
1 answer

Jquery validation getting invalid character when checking

I have a form for a model that has some required fields. I am trying to check those fields unobtrusively. I keep getting a invalid character in a line json.parse of jquery. var formm; if (id == null) { if (!$("#formCDmartAdd").valid())…
Dean.DePue
  • 1,013
  • 1
  • 21
  • 45
-1
votes
1 answer

jquery unobtrusive how to override validation method

I am trying to validate a number that not is required but the native method don't allow this. There is a way to override the native method or I have to add a custom method? Edit
-1
votes
1 answer

How to validate string model property splitted in a few html text boxes?

I have a table in database which has 1 GUID column. It's mapped to entity as simple string property: [Required] public string Code {get;set;} And I want the client to see this property as 4 textboxes? each of them contains a part…
Dmitriy
  • 339
  • 2
  • 14
-1
votes
2 answers

How to use Jquery globalization package for date validation

I'm having problems with my jquery date validation script so I installed the jquery globlization package.I'm very new to packages and installation of packages so I'm not quite sure how to utilize the scripts. I tried doing the following but it still…
TykiMikk
  • 1,058
  • 3
  • 15
  • 31
-1
votes
1 answer

Request.Form["key"] is null after adding JQuery Validate plugin

I have an Edit View with a Form which has two submit buttons: Here I can…
Liiva
  • 278
  • 4
  • 13
-1
votes
1 answer

Disable System.CompositionModel.DataAnnotation from generating db scema instead use it just for unobstrusive jquery validation

I want to use System.CompositionModel.DataAnnotation for building Model but it should not affect database schema for example if I am using Required then it should not make that column as not nullable in Database. The reason I want to use Data…
-1
votes
1 answer

Jquery validation settings (need same behavior)

I am using jquery validation & bootstrap. In views that i only have one form and I dont have to init the validator on the form. I have the input and the validation message span under the input. Styling is great. Red messages etc. However, when i…
-1
votes
2 answers

Client side validation of mvc not working

I am working on a mvc4 project. Layout page: @Scripts.Render("~/bundles/MainScripts") @Scripts.Render("~/bundles/JqueryUIScripts") @Styles.Render("~/Content/MainCss") …
-1
votes
3 answers

What are all validation rules for input type "Password"

I want to display a message on my HTML page to instruct users for what is allowed in Password field. I have following in my HTML markup What are all allowed values for HTML Password inputs?
Nirman
  • 6,715
  • 19
  • 72
  • 139
1 2 3
82
83