简体   繁体   中英

jquery datepicker is not working for second time

jquery datepicker is not working properly. when i click on date input using id for the first time it is showing exactly as expected. But when i click on it for the second time it is showing input field only. When i click outside of the input and coming back to this input the same problem occurs means showing the input only. But it works fine when input control changed. what is the main problem.
i have used the following code
the input is

Begin Date:  
<input type="text" class="span6" required name="begindate" placeholder="Enter Start Date" id="activity_start">

and jquery script is

$('#activity_start').datepicker({changeMonth: true,changeYear: true});

and i am using 1.9.2 jquery ui library file.
please help me how to solve this. sorry for my english.

1.10.2 causing problems

if (!$.datepicker.initialized) {
$(document).mousedown($.datepicker._checkExternalClick);
$.datepicker.initialized = true;
}

1.9.2. version, working as expected

if (!$.datepicker.initialized) {
$(document).mousedown($.datepicker._checkExternalClick)
    .find(document.body).append($.datepicker.dpDiv);
$.datepicker.initialized = true;
}

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