Click here to Skip to main content
15,892,005 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Everybody,

I have a CustomerModel in which have a Property of DateofBirth which is datetime? .

In my view have

@Html.TextBoxFor(modelItem => Model.DateofBirth, new { @placeholder = "mm/dd/yyyy", @minlength = 10, @maxlength = 10 })


Problem : My date required format is MM/dd/yyyy. when i am entering date in this format in crome it is showing an error but it is not working with mozialla.


Pls suggest for that issue . how to resolve it.


thanks
Posted
Comments
Nick Ginis 12-Jun-13 9:24am    
Can you provide the code that does your date validation please?
Anubhava Dimri 14-Jun-13 6:17am    
[DataType(DataType.Date), DisplayFormat(DataFormatString = "{0:MM/dd/yyyy}")]
public DateTime? DateofBirth { get; set; }
Jameel VM 14-Jun-13 6:53am    
what is the error? script error or server error?
Anubhava Dimri 14-Jun-13 8:21am    
when i am entering date 30/02/2000 then error is not generating in mozialla.
Jameel VM 14-Jun-13 8:28am    
check whether the date is saved in server side correctly.Display format is not for validation.I think you need to write custom validation attribute for this.

1 solution

If Mozilla has an issue, it's to do with the javascript being generated, and Mozilla. I don't see any validation code here at all, but if auto generated code does not work with a browser you want to support, then you need to write your own.

If you want specific help, you need to debug in Mozilla and tell us the code that doesn't work and what the error is.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900