I connected to the calendar, in the file myscript.js prescribed

$(document).ready(function(){ $( "#date" ).datepicker({ showOtherMonths: true, selectOtherMonths: true }); }); 

Clicking in the field opens a calendar. When choosing a date, the field is selected, while the calendar itself remains as if the number was not selected, and only then the field is filled with the date. Please tell me the reason?


Update from comments

The connection procedure is as follows:

 <script type="text/javascript" src="js/jquery.js"></script> <script type="text/javascript" src="js/jquery-ui-1.10.4.custom.min.js"></script> <script type="text/javascript" src="js/allscripts.js"></script> <script type="text/javascript" src="js/myscript.js"></script> 

Where can there be a wrong connection?

If you write something at the top of the answer :

 $("#date").datepicker({ showOtherMonths: true, selectOtherMonths: true, /* Кликнули на дату в календаре */ onChange: function(formated, dates){ /* Передаем выбранную дату в наш input */ $("#date").val(formated); /* Прячем календарь */ $("#date").DatePickerHide(); } }); 

then nothing is displayed in the box.

    1 answer 1

    Most likely, you need this:

     $("#date").datepicker({ showOtherMonths: true, selectOtherMonths: true, /* Кликнули на дату в календаре */ onChange: function(formated, dates){ /* Передаем выбранную дату в наш input */ $("#date").val(formated); /* Прячем календарь */ $("#date").DatePickerHide(); } }); 

    Update : confused datepickers ...
    By default, the DatePicker is hidden when choosing a date (click)
    Check the correctness of connecting styles, scripts and the like.
    Here is the full code of the page with the working version:

     <!DOCTYPE html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Demo Page</title> <!-- jQuery --> <script type='text/javascript' src='http://code.jquery.com/jquery-git2.js'></script> <!-- jQuery UI --> <script type='text/javascript' src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script> <!-- jQuery UI CSS --> <link rel="stylesheet" type="text/css" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css"> <!-- Подключаем DatePicker --> <script type='text/javascript'> $(window).load(function(){ $("#date").datepicker({ showOtherMonths: true, selectOtherMonths: true }); }); </script> </head> <body> <input type="text" id="date" value="" /> </body> </html> 
    • @NickVolynkin, I transferred all the information to the question. Comments can be deleted. - VenZell