Click here to Skip to main content
15,891,431 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi

I am using textbox with an property textmode=date. Now I want to hide future date in this text box control how it is possible.
Posted

hi, hope this will help,


http://www.c-sharpcorner.com/Blogs/10848/validation-of-future-date-using-compare-validator-in-Asp-Net.aspx[^]


http://stackoverflow.com/questions/16114778/how-to-use-a-compare-validator-with-datetime-today-against-textbox-text
 
Share this answer
 
You can do as follows .

XML
<script type="text/javascript">
$(function() {
var date = new Date();
var currentMonth = date.getMonth();
var currentDate = date.getDate();
var currentYear = date.getFullYear();
$('#datepicker').datepicker({
maxDate: new Date(currentYear, currentMonth, currentDate)
});
});
</script>


Here in the calendar, the future dates will be disabled.

Please accept and up vote if it helped you. Thanks in advance.

Kindest Regards
Sibeesh Venu
www.sibeeshpassion.com
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900