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
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
jQuery: Date Range Validation
Vincent Maverick Durano
May 04
2015
Code
2.4
k
0
0
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
Here's a quick example on how to disable previous dates based on the date selected from the first calendar date. You can see the actual demo here: http://jsfiddle.net/j3w726r0/
<script type=
"text/javascript"
>
$(
function
() {
$(
"#<%=TextBox1.ClientID%>"
).datepicker({
changeMonth:
true
,
changeYear:
true
,
onSelect:
function
(selected) {
$(
"#<%=TextBox2.ClientID%>"
).datepicker(
"option"
,
"minDate"
, selected)
}
});
$(
"#<%=TextBox2.ClientID%>"
).datepicker({
changeMonth:
true
,
changeYear:
true
,
onSelect:
function
(selected) {
$(
"#<%=TextBox1.ClientID%>"
).datepicker(
"option"
,
"maxDate"
, selected)
}
});
});
</script>
jQuery
Date Range Validation