I have extended the default registration form in ASP.NET MVC with 2 jquery-ui datepickers.
<div class="form-group">
@Html.LabelFor(m => m.LicenseDateOfIssuance, "Date of Issue", new { @class = "col-md-3 control-label required-field" })
<div class="col-md-9">
@Html.EditorFor(m => m.LicenseDateOfIssuance, new { htmlAttributes = new { @class = "form-control DateTimePicker", placeholder = "Date of Issuance", @readonly = "true" } })
</div>
</div>
<div class="form-group">
@Html.LabelFor(m => m.LicenseDateOfExpiry, "Date of Expiry", new { @class = "col-md-3 control-label required-field", placeholder = "eg 1 Jan 2015" })
<div class="col-md-9">
@Html.EditorFor(m => m.LicenseDateOfExpiry, new { htmlAttributes = new { @class = "form-control DateTimePicker", placeholder = "Date of Expiry", @readonly = "true" } })
</div>
</div>
I would like to compare the dates held by both datepickers and ensure that the expiry div's date is later than the issuance div.
Any suggestions would be very much appreciated.