How To Disable Future Date In jQuery Datepicker

Websolutionstuff | Jun-17-2022 | Categories : Laravel PHP jQuery

In this tutorial, we will see how to disable future dates in jquery datepicker. In the date picker, today's date after any future date will be disabled using the jquery UI date picker. The jquery UI Datepicker is easy to customize as per requirements.

So, let's see jquery datepicker disable future dates, future date disable in datepicker, disable future dates in jquery UI datepicker, how to disable future date in calendar using javascript, bootstrap datepicker disable future dates, datepicker disable future dates in javascript, how to disable future date in input type date, how to set max date in datepicker, how to set max date as current date in datepicker, jquery ui datepicker maxdate today.

Example:

<!DOCTYPE html>
<html>
<head>
    <title>How To Disable Future Date In jQuery Datepicker - Websolutionstuff</title>
    <link href="http://code.jquery.com/ui/1.9.2/themes/smoothness/jquery-ui.css" rel="stylesheet" />
    <script src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
    <script src="http://code.jquery.com/ui/1.9.2/jquery-ui.js"></script>
    <style type="text/css">
        .container{
            border-radius: 5px;
            padding:50px 20px;
            margin:30px auto;
            width:40%;
            border:2px solid #bbb;
            text-align: center;
        }
        input{
            padding:5px;
            background-color:#eeeeee;
        }
        h2{
            text-align: center;
            margin-top: 100px;
            font-weight: 600;
        }        
    </style>
</head>
<body>
    <h2>How To Disable Future Date In jQuery Datepicker - Websolutionstuff</h2>
    <div class="container">
        <label>Select Date :</label>
        <input type="text" id="datepicker">
    </div>
</body>
<script type="text/javascript">
    $(function() {
        $( "#datepicker" ).datepicker({  maxDate: new Date() });
    });
</script>
</html>

 

 

Output:

how_to_disable_future_date_in_jquery_datepicker_output

 


You might also like:

Recommended Post
Featured Post
Laravel 9 Generate PDF From HTML Using TCPDF
Laravel 9 Generate PDF From HT...

In this article, we will see laravel 9 generate PDF from HTML using TCPDF. Here, we will learn how to integrate tcpdf in...

Read More

Jan-31-2023

How to Install Zoom in Ubuntu 22.04 using Terminal
How to Install Zoom in Ubuntu...

Greetings Ubuntu enthusiasts! If you're ready to dive into the world of video conferencing on your Ubuntu 22.04...

Read More

Jan-19-2024

How to Clear Form Data Using jQuery
How to Clear Form Data Using j...

In this concise tutorial, we will explore the process of clearing form data efficiently using jQuery. We will focus on r...

Read More

Jul-13-2021

Laravel 9 Many To Many Relationship Example
Laravel 9 Many To Many Relatio...

In this article, we will see laravel 9 many to many relationship example. Also, you can use many to many relationsh...

Read More

Apr-03-2022