Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

prevent datepicker close when clicking outside [closed]

I am using jquery datepicker .I want to prevent close functionality when clicking outside of calendar dialog box.

url:-http://jqueryui.com/datepicker/

Thanks

like image 491
user7789076 Avatar asked Oct 08 '13 07:10

user7789076


2 Answers

In jquery.ui.datepicker.js this is the code for hiding calendar when clicking outside:

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

So you can remove this event handler by using:

$(document).unbind('mousedown', $.datepicker._checkExternalClick);
like image 105
BMH Avatar answered Nov 05 '22 00:11

BMH


If you create the datapicker on a div rather then an input box it will stay open all the time.
Is this what you want or should it be clicked upon to open and then stay open forever?

like image 1
Kristof Avatar answered Nov 05 '22 01:11

Kristof