I am showing datetime values ββin a readintly text box (type = "text") and it displays correctly. But when I try to save it, HTML5 highlights the border of the text field, which I think means that it couldnβt confirm the HTML5 date. Is it because of the format? If this is how to change the format ?. Another option, if possible, might be to disable html5 checking by default, but I'm curious to know its behavior. Server side code below:
<div class="panel-body in">
<fieldset class="scheduler-border">
<div class="form-group form-group-textarea">
<div class="col-sm-4">
@Html.LabelFor(m => m.LastUpdatedImage, new { @class = "control-label" })
</div>
<div class="col-sm-8">
@Html.TextBoxFor(m => m.LastUpdatedImage, new { @class = "form-control", @readonly = "readonly" })
</div>
</div>
<div class="form-group form-group-textarea">
<div class="col-sm-4">
@Html.LabelFor(m => m.LastUpdated, new { @class = "control-label" })
</div>
<div class="col-sm-8">
@Html.TextBoxFor(m => m.LastUpdated, new { @class = "form-control", @readonly = "readonly" })
</div>
</div>
<div class="form-group form-group-textarea">
<div class="col-sm-4">
@Html.LabelFor(m => m.LastPrinted, new { @class = "control-label" })
</div>
<div class="col-sm-8">
@Html.TextBoxFor(m => m.LastPrinted, new { @class = "form-control", @readonly = "readonly" })
</div>
</div>
<div class="form-group form-group-textarea">
<div class="col-sm-4">
@Html.LabelFor(m => m.LastExported, new { @class = "control-label" })
</div>
<div class="col-sm-8">
@Html.TextBoxFor(m => m.LastExported, new { @class = "form-control", @readonly = "readonly" })
</div>
</div>
<div class="form-group">
<div class="col-sm-12">
<input type="button" onclick="javascript:GetPropertySummaryDetails(@PropertyCode);" name="ShowSummary" id="ShowSummary" class="btn btn-primary" value="Export" />
</div>
</div>
</fieldset>
html, which is created for one of the text fields:
<input class="form-control input-validation-error" data-val="true" data-val-date="The field Images Updated must be a date." data-val-required="The Images Updated field is required." id="LastUpdatedImage" name="LastUpdatedImage" readonly="readonly" type="text" value="21/05/2015 15:51:49">
Image below:

source
share