使用Mozilla在MVC Razor中按日期进行客户端验证 [英] Client Side Validation on Date in MVC Razor with Mozilla

查看:117
本文介绍了使用Mozilla在MVC Razor中按日期进行客户端验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我有一个CustomerModel,其中的 DateofBirth 属性是日期时间? .

我认为有

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 })



问题:我需要的日期格式是MM/dd/yyyy.当我在crome中以这种格式输入日期时,显示错误,但不适用于mozialla.


请为这个问题提出建议.解决方法.


谢谢



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

推荐答案

如果Mozilla有问题,则与正在生成的javascript和Mozilla有关.我完全看不到任何验证代码,但是如果自动生成的代码无法与您要支持的浏览器一起使用,那么您需要编写自己的代码.

如果您需要特定的帮助,则需要在Mozilla中进行调试,并告诉我们无法使用的代码以及错误所在.
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.


这篇关于使用Mozilla在MVC Razor中按日期进行客户端验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆