4

我正在使用 razor 视图页面,在日期时间字段中我想显示占位符,它在 Firefox 中显示,但在 chrome 中没有显示它的显示 - mm/dd/yyyy

她的是我的代码 -

 @Html.EditorFor(model => model.Date, new { htmlAttributes = new { @class = "form-control form-inline", @placeholder = "Date must be today's or past date" } })

火狐截图

铬的屏幕截图

我该如何解决这个问题。??

4

1 回答 1

0

日期类型不支持占位符属性。此外,WebKit 实现说它是固定的。

http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary

于 2017-03-26T23:20:47.440 回答