简体   繁体   中英

To disable all past dates except one particular date in JQuery datepicker

I have a datepicker in which past dates are disabled. Since past dates are disabled I could not render a past date in that field.

Is it possible to render a past date and restrict past date on editing a datepicker field?

use this code for open a date picker

 $(document).ready(function () { $("#txtdate").datepicker({ minDate: 0, }); });
 <html> <head> <title>DatePicker</title> <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> </head> <body> Date: <input id="txtdate" type="text"> </body> </html>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM