JQuery datepicker not working in IE7 and IE8

This is my js:

$(document).ready(function() {
 $("input#dateTill").datepicker();
});

My HTML:

<input type="text" name="dateTill" id="dateTill" class="input" value="20.1.2011" maxlength="10" size="10" style="margin-left: 0; background: url(images/icons/16_calendar.png) 75px center no-repeat;" />

Datpicker works in all regular browsers, such as Firefox, Chrome, Opera. It does not work in IE7 and IE8.

When I click inside the input field, the datepicker window does not appear.

Any ideas? I am using jquery 1.4.4.

+3
source share
1 answer

First of all, just make sure not to use the same string for the identifier and the name property. And for God's sake, do not define your class with a reserved word like input, its and inner class / element. Go for something like pickerClass. In addition, I think your jQuery selector syntax is incorrect, there is no need for an input part, you already have an identifier for this element. It:

$("#dateTill").datepicker();

OR

$("input.pickerClass").datepicker();

- . , CSS-, CSS, .

+8

Source: https://habr.com/ru/post/1786611/


All Articles