- <div class="row">
- <div class="col-xs-12 col-sm-6 col-md-6">
- <div class="form-group">
- From Date
- @Html.TextBoxFor(m => m.FromDate, new { @class = "form-control", @tabindex = "2" })
- @Html.ValidationMessageFor(m => m.FromDate, "", new { @class = "label-danger" })
- </div>
- </div>
- </div>
-
- <div class="row">
- <div class="col-xs-12 col-sm-6 col-md-6">
- <div class="form-group">
- To Date
- @Html.TextBoxFor(m => m.ToDate, new { @class = "form-control", @tabindex = "2" })
- @Html.ValidationMessageFor(m => m.ToDate, "", new { @class = "label-danger" })
- </div>
- </div>
- </div>
I need to validate like to date should be greater than or equal to from date, or if user select from date I need to block all the dates which are less than to date. I tried the following code to disable the dates before from date, but it is not working
- $("#FromDate").on("change.dp", function (e) {
- $("#ToDate").datepicker("option", "minDate", e.date);
- });