How to disable past dates on datepicker

Sample -1

$( “#datepicker” ).datepicker({ minDate: 0});

 

Sample -2

This is a BootStrap Date picker You have to add BootStrap CDN for this 

<script language=”javascript”>

$(‘.datepicker’).datepicker({

    startDate: new Date()

});

</script>

Sample -3 

This Is JQuery DatePicker you have to add JQuery Cdn for this 

<link href=”http://code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css” rel=”Stylesheet”
        type=”text/css” />
    <script type=”text/javascript” src=”http://code.jquery.com/jquery-1.7.2.min.js”></script>
    <script type=”text/javascript” src=”http://code.jquery.com/ui/1.10.4/jquery-ui.js”></script>

<script language=”javascript”>
    $(document).ready(function () {
        $(“#txtdate”).datepicker({
            minDate: 0
        });
    });
</script>

Leave a Reply