Tagged Questions
0
votes
1answer
43 views
Need approach to be able to validate div with elements(using unobtrusive/jquery validation plugin) without having any form on view
I have been assigned to a MVC3 project recently where i need to add client side validation to all of it's pages.
unfortunately this project has many pages which don't have any form on it in entire ...
0
votes
1answer
49 views
Dataannotations Required showing default message
I'm having problems with jquery validation showing the default required validation message.
I add these textboxes dynamically using javascript. And I assume some class is missing for it to trigger ...
0
votes
2answers
140 views
How to get unobtrusive client-side validation on a Required List<> of objects in MVC?
I have a model in which an employee contains a list of functions. The employee should at least have one function.
public class Employee
{
[Required(ErrorMessage = "Name is Required")]
public ...
0
votes
1answer
75 views
Validation in MVC
I am using MVC 3 asp.net and Razor, how to validate these drop down boxes on client side? Like if no value is selected that pass error to user that please select value.
I have added linq to sql ...
1
vote
1answer
103 views
Global settings for jQuery valdiator method
I am sorry for my simple question but I can't get it work .
How I can make this jquery validator method to work globally .
I have this code in my layout:
jQuery.validator.methods.number = function ...
0
votes
0answers
135 views
jquery events not fire in IE + client side validation mvc
Hi I'm developping my own client side validation in MVC using jquery and jquery.validate :
My client side validator fire but I add a jquery code my validator to launch on other validator.
define([
...
0
votes
1answer
277 views
ASP .NET MVC 3 unobtrusive validation fails for Required
I'm struggling with ASP .NET MVC 3 unobtrusive validation. My simple model contains of this field:
[Display(Name = "Starting Amount")]
[Required(ErrorMessage = "Starting Amount is required.")]
public ...
0
votes
0answers
101 views
How to use jquery custom validation plug-in for mvc
MVC validation is ok but lots of free & fancy jquery validation plug-in are available. so how could i incorporate custom jquery validation plug-in for MVC model validation instead of using default ...
0
votes
2answers
77 views
regex not working for ZipCode
HTML
<form action="#" id="MyForm" name="MyForm">
<p id="message"></p>
<table id="tblData">
<tr>
<td>
<label for="A">
...
0
votes
0answers
74 views
check only one method in jquery.validate
I created a custom validator that contain 5 methods like this:
define([
'jquery',
'jquery.validate',
'jquery.validate.unobtrusive',
'passwordrules'], function($, validator, unobtrusive, ...
0
votes
1answer
400 views
Validation of field inserted with after or append
I have a form with ASP MVC3, and the input fields are validated with jQuery validate plugin v1.8 (default jQuery validation with MVC3). This is working perfectly, but the problem is when I insert a ...
2
votes
1answer
142 views
How to trigger a remote validation when a select list changes
I'm using MVC3 and unobtrusive validation to check my form. The user can select a facility from a list, and enter an audit name. The audit names must be unique for the facility, but can each facility ...
-1
votes
3answers
834 views
validation for either or dynamic textbox in mvc3 razor?
I have a form that form loads a partial view when i select the dropdown values.Here the partialview loads two dynamic textbox with different ID values.
@model ...
0
votes
1answer
194 views
Parameter must match the name of the field being validated: User.Username
As the title, i using remote validation to valid the Username field. But the name of the field in Html is User.Username. How can i pass the parameter with the name having dot User dot Username. If ...
0
votes
1answer
234 views
custom message error jquery validate
I need to custom eror message in my client side validation like this (i'm using mvc client side validation)
define([
'jquery',
'validate',
'unobtrusive'
], function ($, validator, ...
0
votes
0answers
221 views
Serializing and Validating Multiple Forms with a common Button and Validation Summary
I have two Forms on a view - each in a different tab. I have a Button and a Validation Summary placed outside the forms.
What I want to achieve is that, when a user clicks that button I want to ...
0
votes
1answer
57 views
JQuery unobtrusive still validates removed HTML DOM
I have an ajax partial view that is created, and after it's created I use
jQuery.validator.unobtrusive.parse('#recommend_fields');
To turn on unobstrusive validation!
Great!
Now when I completely ...
0
votes
2answers
505 views
.NET MVC unobtrusive validation / checkbox captcha
I'm trying to implement a checkbox captcha I read about here:
http://uxmovement.com/forms/captchas-vs-spambots-why-the-checkbox-captcha-wins/
However I'm having issues adding the checkbox with client ...
2
votes
1answer
2k views
Making a field as required in Razor view
I want to make a text box field as required in the razor view. I can't use validation attribute [Required] because the field names are generated dynamically. I checked this answer which sets the ...
1
vote
1answer
511 views
jQuery Unobtrusive Validation - remote validation gives false positives and settings being ignored?
I thought I had a pretty bullet-proof set up for using jQuery Unobtrusive Validation for MVC web apps but a recent bug has me very puzzled.
I want all the validation to be consistent so use remote ...
2
votes
1answer
571 views
using asp.net mvc3 with jquery.validate.unobtrusive.js to validate form and changebutton
I am working with mvc3 and use model validation like this:
public class ColumnVM {
[Required(ErrorMessage = "Required")]
public string Name { get; set; }}
I want to do clientside ...
0
votes
1answer
94 views
modifying ModelState on the client
So here's the problem: I have a form and a property adorned with [RequiredAttribute] altough initialy it's hidden on the form. There's a checkbox.
When it's clicked it shows the element. So I wanted ...
0
votes
3answers
138 views
Why HtmlHelper would skip validation attributes
Why @Html.TextBoxFor and other helpers would skip jquery.validation attributes and create elements without those? Am I missing some references or something? It's MVC 3.0 project.
If I add them ...
0
votes
2answers
287 views
Remote action method not being hit using jQuery Validate
I am using ASP.NET MVC4 and jQuery Validate and jQuery Validate unobtrusive.
I have various elements on my form, but I only need to have one element validated. The other elements DO NOT need to be ...
0
votes
0answers
417 views
How to use JQuery Custom Validators and onChange Event in <input type='file' /> using ASP.NET MVC 3
Invoking custom jquery validator within another javascript function
How to invoke jQuery Custom Validator for a <input type='file' /> on onChange Event within normal javascript function. I ...
0
votes
1answer
617 views
jQuery multiple tabs + validation select does not fire (MVC3/Razor/VB)
I've used a solution here (which I've fiddled here) for restricting submission of a form until all required fields are filled.
The problem is when I run on my MVC3 project, as I've observed on ...
1
vote
1answer
255 views
How to re-fire jquery functions after failed validation
I am building a form using asp MVC3 and MVC Unobtrusive validation. I noticed some of my jquery functions do not run again after the failed validation. For example, I have a datepicker on a textbox ...
2
votes
2answers
2k views
How DateTime is validated in MVC Unobtrusive Validation?
Using MVC4 with client-side & unobtrusive validation enabled, I'm trying to understand how the validation determine if an entered DateTime value is valid or not.
In my application this formatted ...
1
vote
1answer
342 views
How do I get unobtrusive validate to clear required validation on an email input?
I have a mobile application I'm writing in ASP.Net MVC3 (using JQuery unobtrusive validate). As part of it, I am collecting name and email information from the users. My model includes fields like:
...
2
votes
1answer
2k views
MVC3/4 Validating Hidden Fields
I have set up model validation for my form but validation doesn't seem to work at all. I don't suppose anybody can help. I've tried using the below work-around but that keeps pulling up an 'undefined' ...
5
votes
1answer
5k views
jquery client side validation not working in MVC3 partial view
I could not seem get client side validation work with the following partial view. This view is inside divTSettings div in the parent view. Tried lots of things from stackoverflow and other sites, ...
1
vote
1answer
343 views
ASP.NET MVC3 EditorTemplates and Name Attributes
I am using editor templates in my code and what I noticed is that lot of the controls get the name property set based on index.
@Html.EditorFor(x => x.Emails)
Where Answers is collection of ...
0
votes
2answers
79 views
Validating other fields depending on select
I have this in my view:
@using(Html.BeginForm())
{
<label> Condition Target </label>
<input type="text" name="ConditionTarget1" id="ConditionTarget1"/>
<input ...
2
votes
1answer
617 views
MVC3 ModelClientValidationRule compare 2 different fields. Adding a required flag to either
I am trying to create a custom validation using IClientValidatable
I have 2 fields PhoneNumber and Mobile. I want the user to either or both. Only 1 is required but at least one must be provided.
I ...
1
vote
1answer
595 views
Valid values for ModelClientValidationRule ValidationType string?
Is there a lsit of what validation rule types are directly available, without having to code a new one?
e.g.
JQuery.validation has "min(value)"
But I have tried
var rule = new ...
2
votes
2answers
358 views
How do I prevent MVC unobtrusive validation for required field from also activating email validation?
I have an ASP.NET MVC login form, that uses client-side unobtrusive validation.
My login model has a UserName with a [Required] attribute.
Most of the usernames entered will be email-addresses, so on ...
0
votes
0answers
298 views
Validating MVC 4 form without Unobtrusive ajax
I am trying to validate my form without using Unobtrusive Validation becauase my validation is a little more complicated than average. What is needed to accomplish this? Just include the ...
0
votes
2answers
1k views
Date comparison in asp.net mvc3 model
I have two fields in my model
CreateDateTo
CreateDateFrom
which renders like this
<b>Start Date</b> @Html.EditorFor(model => model.AdvanceSearch.CreateDatefrom, new { @class = ...
3
votes
2answers
410 views
ASP.NET MVC3 Client side validation without form tag
I have a view which contains some input fields. They are bound to a viewmodel. They also have validation messages. But the view doesn't have a form tag (neither Ajax.BeginForm nor Html.BeginForm).
...
1
vote
1answer
355 views
Custom ValidationSummary template (that doesn't break client-side validation)
A similar question has been asked before (Custom ValidationSummary template Asp.net MVC 3) but neither of the answers satisfy the extra requirement I have, which is that the solution doesn't break ...
2
votes
1answer
449 views
Handling line breaks in textarea elements with ASP MVC and jquery unobtrusive validation
Viewmodel:
public class ViewModel
{
[Display(Name = "Message")]
[StringLength(500, ErrorMessage = "Your message must be {1} characters or fewer.")]
public string Message { get; set; }
}
...
1
vote
1answer
2k views
Client validation in partial view that is rendered in jquery dialog, without Unobtrusive
I have login partial view in jquery dialog box.when I click on "Login" button with empty textboxes, error should be shown, but it goes with null value to server and get this error.
I want to use ...
1
vote
1answer
182 views
Adding validation property attributes in views with Html.EditorFor() methods not inside a Html.BegingForm() method
I have noticed that validation attributes are only added to the elements that were created via Html.EditorFor() helper method and which are inside a Html.BegingForm() method, that respectively creates ...
0
votes
2answers
376 views
dropdownlistfor + jquery validation
I am creating an application in asp .net mvc3 c#. I create a dropdown list but I am unable to do a client side validation using Jquery.
I have looked at numerous articles related to it and know that ...
0
votes
0answers
163 views
Validation multiple text fields MVC 3
I want to do the validation of multiple text fields
Values must be between 0 and @ViewBag.MaxNote
In the view I have the following:
@model IList<RolesMVC3.Models.STUDENTS>
<P>Please ...
0
votes
2answers
106 views
Unobtrusive validation - how to find a dependent property for comparison
working on an MVC 3 app. I have finished my custom server side code, now working on the client side. I want to tie it in to the existing unobtrusive, so I am using the addMethod. The pseudo goes ...
2
votes
3answers
291 views
Validation of child object
I have an object that contains a child object. eg.
public class Person
{
public string Name { get; set; }
public Car Car { get; set; }
}
public class Car
{
public int CarId{get;set;
...
1
vote
1answer
758 views
Display:none fields not being posted to controller
I have a lightbox that contains a bunch of input elements that I have set up using HTML helpers for a create action. They are optional fields, but I do apply the digit rule to them in jquery ...
5
votes
3answers
5k views
Fire jquery unobtrusive validation with bootstrap , Asp.net Mvc 3 and backbone
I tried to find the bits of information available on the net, But couldn't hook it up together. I have an application which makes use of a login page. Now I'm not binding the view to any model. ...
1
vote
2answers
969 views
jQuery validate greater than & less than
How do I ensure that a user cannot enter a value smaller or bigger than a certain value ?
The problem lies in making a validation of a field having a value smaller or bigger than another field.