我在readonly文本框(type =“text”)中显示日期时间值并正确呈现.但是当我尝试保存它时,
HTML5会突出显示文本框边框,我认为这意味着HTML5日期验证失败了.是因为格式?如果是,那么如何更改格式?如果可能的话,另一个选项可能是禁用默认的html5验证,但我很想知道它的行为.服务器端代码如下:
@Html.LabelFor(m => m.LastUpdatedImage, new { @class = "control-label" })
@Html.TextBoxFor(m => m.LastUpdatedImage, new { @class = "form-control", @readonly = "readonly" })
@Html.LabelFor(m => m.LastUpdated, new { @class = "control-label" })
@Html.TextBoxFor(m => m.LastUpdated, new { @class = "form-control", @readonly = "readonly" })
@Html.LabelFor(m => m.LastPrinted, new { @class = "control-label" })
@Html.TextBoxFor(m => m.LastPrinted, new { @class = "form-control", @readonly = "readonly" })
@Html.LabelFor(m => m.LastExported, new { @class = "control-label" })
@Html.TextBoxFor(m => m.LastExported, new { @class = "form-control", @readonly = "readonly" })
为其中一个文本框生成的html是:
图片如下: