Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have this code  

          $("#FromDate").datepicker({
                changeMonth: true,
                changeYear: true,
                yearRange: "-100:+10",
                dateFormat: 'dd-M-yy',
                onSelect: function (dateStr) {
                    var max= new Date(dateStr);
                    max.setDate(max.getDate() + 1);
                    $('#ToDate').datepicker('setDate', max);
                    $("#ToDate").attr('readonly', true);
                }

            });

ToDate datepicker date is set properly and also looked readonly. but when i click on ToDate it's shows me the date calendar. which should not populated as per my need.
Kindly suggest what should I do?


What I have tried:

$("#ToDate").attr('readonly', true);
Posted
Updated 13-Mar-18 17:29pm

1 solution

You can try something from this post. JQuery DatePicker ReadOnly - Stack Overflow[^]

Here is a working example:
CP_datepicker_readonly - JSFiddle[^]
 
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