TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Dorababu Meka
227
8.3k
1.7m
MVC validate bootstrap date time picker
Oct 17 2016 5:05 AM
<
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);
});
Reply
Answers (
6
)
Web page Design
How can I create a program that I explain below in HTML?