Only in IE with this code
$('#datepicker').datepicker({
onSelect : function(x, u){
$(this).focus();
}
});
when I select a date, the datepicker reopen itself because I added $(this).focus();
in onSelect
. How I can to resolve this issue? (Example)
I'm using jquery 1.8.2 and jquery-ui 1.9
You can restrict the users from selecting a date within the particular range by specifying MinDate and MaxDate properties. The default value of MinDate property is 1/1/1920 and MaxDate property is 12/31/2120 . Dates that appears outside the minimum and maximum date range will be disabled (blackout).
$(document). mouseup(function (e) { $('#example1'). Close(); });
Syntax: $(". selector"). datepicker("hide");
The requirement is also to be able to use dates in the format "dd-MMM-yy". For example, in the first date field, the user selects 26-Nov-16. Then, when they click on the date picker for the second date field, the earliest date they are able to select is 26 Nov.
I came across this issue today and had a different solution work for me. My scenario was that my DatePicker was inside a jQuery UI Dialog popup. Everything worked fine in Chrome, but in IE, the calendar would always reappear after selecting a date.
As it turns out, there is an open bug for this in jQuery 1.10.1: http://bugs.jqueryui.com/ticket/9125
There is also a JSFiddle linked to that demonstrates the bug in IE. There are two ways to get this to work in IE:
modal
to false
I went with #2, and here is an example of the fix (just updating the JSFiddle code):
Markup:
<div id="dialog">
<input id="datepicker" />
<input type='button' value='save' id='btnSave'/>
</div>
JS:
$( "#datepicker" ).datepicker({onSelect: function() { $('#btnSave').focus(); }});
$( "#dialog" ).dialog({ modal: true });
Hopefully this helps someone in the future!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With