Tagged Questions
0
votes
3answers
51 views
Regx for Date Validation in javascript
pls can somebody give the date validation regx, which will allow the following rules are
It should allow mm/dd/yyyy, m/d/yyyy, mm/d/yyyy, m/d/yyyy (not allow yy)
Number of days for month (30 and ...
2
votes
1answer
39 views
Hook success event MVC validation (per field)
I'm removing the default error messages on my form and I'm replacing them with some tooltips.
Is there a way to capture the validation event for each field?
When a users starts typing some text in ...
0
votes
2answers
28 views
MVC 4 minvalue validation in View
I'm using NHiberante & MVC 4 and in my View I've this:
<div class="editor-field">@Html.EditorFor(model => model.NumOfTransporters)</div>
I want to validate this field against a ...
0
votes
2answers
29 views
Validate a string to be one of two lengths
Is it possible to use ASP MVC's DataAnnotation to require a string to be one of two lengths? This example obviously doesn't work but I am thinking of something along these lines
[Required]
...
0
votes
1answer
43 views
Data validation not working in view (DataAnnotations)
I'm having trouble getting data validation working in my view.
I believe 'AssetName' should show an error message if a user tabs into the textbox and doesn't put any data in but no message is shown ...
0
votes
1answer
53 views
ASP.NET MVC 4 Validation Errors not being displayed
I'm using ASP.NET MVC 4.
I don't think my ModelState is being passed properly,
Controller action: Home/EnrolResult as follows:
[HttpPost]
public ActionResult EnrolResult(UploadModel model)
{
...
0
votes
3answers
41 views
Display validation error when TimeSpan model binding exceptions occur
In an ASP.NET MVC 4 application I have a view model that contains a nullable TimeSpan property:
[DisplayName("My time")]
public TimeSpan? MyTime { get; set; }
It is bound to an input element in the ...
1
vote
1answer
56 views
How to implement Date Range Validator in MVC 4
I want to restrict user from entering a date except a particular range in my MVC 4 application. Please suggest how can I do this.
1
vote
1answer
53 views
Jquery Validation WITHOUT Data Annotation in MVC
I want to create a page, in MVC, where there is a label, a textbox and a save link. Textbox will be initially in read mode and on double click of the textbox it is gonna come in edit mode. And when we ...
1
vote
1answer
53 views
asp.net mvc datetime dynamic validation by clients date format
I have a Custom Attribute for DateTime validation with given dateformat and also javascript validator which are provide me both client side and server side validation. But now I should change my ...
0
votes
2answers
62 views
How can I inject a Command Validator and update ModelState before Action starts
A lot of our architecture is orientated around Commands ICommandHandler. We post a Command model to the controller action. The command/model is then validated in each action by running validator (if ...
0
votes
1answer
15 views
MVC automatically tags as required. How do I prevent/suppress automatic tagging for validation?
I have a model with int fields, such as UserTypeID. I am not using [Required] attribute.
However, the MVC (3.0) generates HTML with required attributes, and the validation message kicks in when I try ...
0
votes
1answer
53 views
ModelState validity using ViewModel
I have a table Product, a table ProductType and finally a table ProductCompanies. Here is their relation :
I have a ProductViewModel which is like this :
public class ProductViewModel
{
...
0
votes
0answers
55 views
ASP.Net MVC 4 - Fields with IClientValidatable not rendering properly
I have a hybridized project (originally WebForms) with ASP.Net MVC 4.
In this project, the MVC portion, I am wanting to use unobtrusive client validation. I have a number of validation attributes ...
0
votes
0answers
39 views
CustomTypeDescriptor with MVC Validation - How to get property value with property.GetValue(component)?
I've created custom TypeDescriptionProvider for one of my MVC models. I use it for dynamic assignment of ValidationAttribute.
I use value of one property to decide what attributes to add to other ...