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
0
votes
2 answers

unobtrusive javascript reloads data entry form before form is submitted

I'm using ASP.Net MVC and implementing unobtrusive javascript for form validation. Here's my code: @{ AjaxOptions options = new AjaxOptions { HttpMethod = "Post", LoadingElementId = "ProcessingMessageContainer", Url =…
Tom Schreck
  • 5,177
  • 12
  • 68
  • 122
-1
votes
1 answer

Javascript function to validate form by ASP.NET Core Jquery validation

I'm trying to validate an ASP.NET Core form without refreshing the page by ASP.NET Core JQuery validation (the one provided in the project). The validation is working properly when I post the form normally. But I want to post the form with AJAX, so…
user17476959
-1
votes
1 answer

Unobtrusive client validation only firing on first property in collection

I'm wrote a custom ValidationAttribute that also implements IClientValidatable so that I can perform client-side validation using the Jquery.Unobtrusive library. The issue I have is that even though I have multiple items in the…
Agreene
  • 508
  • 7
  • 16
-1
votes
1 answer

MVC Form Data Validation and jquery validation

I am using MVC Data Validation for TextBoxFor and DropDownListFor and its working nice. But I also wanted to add jquery validation for checkbox list is there a way to add that as well? In my document.ready function I call ready validate(); which add…
user5843610
-1
votes
1 answer

"Uncaught TypeError: Cannot read property 'setDefaults' of undefined" in console when page is loaded

After updating the Jquery.Validation to version: 1.19.2, the error started displaying in the console on page load, it was not throwing errors with the older versions. This is my code: var defaultOptions = { validClass: '', errorClass:…
Martin90
  • 1
  • 6
-1
votes
2 answers

.NET Core with jquery.validate.unobtrusive: error messages are missing

I am using jquery.validate.unobtrusive with .NET Core to do client-side validation. I see the form validation is working (upon error the input is turning red ...) but I do not see the error messages. I think error messages should be visible, at…
Node.JS
  • 1,042
  • 6
  • 44
  • 114
-1
votes
1 answer

validator - unobtrusive form reset not working

I'm using adminlte v 3.0.1. bootstrap doing some validator and unobtrusive stuck at resetting form, in example edit => show modal form => trigger validation => cancel => new => validation result still there I'm already tried…
-1
votes
1 answer

Client-Side unobtrusive validation not working as expected

I am implementing Custom Unobtrusive client-side JavaScript for an MVC Application. The custom validation method ([EnforceTrue] Attribute) does fire when I press the submit button, but it does not have any effect. In the submit event, The…
-1
votes
1 answer

Handling multiple submit buttons on the same form

I'm creating a page that has multiple submit buttons on the same form. At first, all the buttons worked normally, but when I added a field with remote validation a strange behavior started happening. 1º Simulation (It doesn't work): Write an email…
-1
votes
2 answers

jquery .valid() not working when resending the same form

I think this it's simple but I can't figure it out, I have a form a simple one that asks for a name, date one and date two. when you submit here's the jquery $('#searchRange').on('submit', function (e) { e.preventDefault() var x…
-1
votes
1 answer

JQuery validation for nested model

I have this model: public class TutorialBindingModel { [Required] [RegularExpression(@"[A-Za-z0-9\ \-_]+", ErrorMessage = "You are using invalid characters")] [StringLength(128, ErrorMessage = "The {0} must be max 128 characters…
Artyom
  • 654
  • 2
  • 7
  • 16
-1
votes
1 answer

Validate a field inside a validation function

This is related to this question: Validation for selecting a minimum and maximum So I have two fields one for minim and one for maxim that the user must enter. I need to have a validation on both field that they are correct minim < maxim. I have the…
Dan
  • 683
  • 2
  • 8
  • 24
-1
votes
3 answers

jquery validation displays no error message

I am trying to use jquery validation, but for some reason no error message shows up, even though I try to follow various examples:
Dmytro
  • 47
  • 2
  • 10
-1
votes
1 answer

Date error message not disappearing after validated

If someone would forget to put in the date and then click submit we would get "Date of Visit is required" as expected, but then after the date is populated the "required" message doesn't disappear as it does with every other field. I can still click…
-1
votes
1 answer

Adding custom CSS to element when unobtrusive validation failed

I'm trying to add a CSS class to a textbox when validation fails. @Html.TextBoxFor(x => x.AdminUser.Username, new { @id = "Username", @name = "Username", @type = "text", @class = "form-control", @placeholder = "Kullanıcı Adı", …
Alparslan
  • 54
  • 6