Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
5
Reply
MVC validate bootstrap date time picker
Dorababu Meka
Oct 17 2016 5:05 AM
513
Reply
<
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);
});
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
5
)
Next Recommended Forum
Web page Design
How can I create a program that I explain below in HTML?