Fix issue Date Picker show ‘True’ in SharePoint 2010 when working with IE 11

I got this issue when working with SharePoint Date Picker fields in IE 11.

ShowTrue

After researching from Google, I see a post which has the same issue: http://sharepoint.stackexchange.com/questions/46380/date-field-shows-the-word-true-instead-of-a-calendar-after-clicking-the-date-p

So here is my solution, you can follow the solution from Craig: Replace all SharePoint Date Picker by jQuery UI Date Picker by using the script below (but I think it’s quite risky):

function ImproveDateTextBoxs() {
    $("input[id$='DateTimeField_DateTimeFieldDate']").each(function () {
        ImproveDate($(this));
    });
}

function ImproveDate(obj) {

    obj.focus(function () { obj.select(); });

    if (typeof jQuery.ui.datepicker != "undefined") {
        obj.datepicker({
            dateFormat: "dd/mm/yy",
            showOtherMonths: true,
                selectOtherMonths: true,
            showButtonPanel: true,
            changeMonth: true,
            changeYear: true
        });

    obj.parent().next().children("a").removeAttr('onclick');
    obj.parent().next().children("a").click(function () { obj.select(); });
    }
}

Fix1

Or change the Document Mode in Master Page to IE 10 (or 9,8), like this:

<meta http-equiv=”X-UA-Compatible” content=”IE=10“/>

Fix2

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s