Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

We're having this problem across all of our sites since migrating to SP2010. Occasionally (let's say 1/50 times), when you click the Calendar icon on a date, instead of seeing a calendar, you see the word "true" written where a calendar should be. The area that would normally occupy a calendar is white, suggesting that a div tag has been added to the page, but there is no calendar. You cannot dismiss the fake-calendar. You have to refresh the page. Below is an image of the problem. We can't determine any sort of pattern or correlation. I haven't been able to find anyone else having this problem online when I searched.

Has anyone else experienced this? Have you come up with a solution or figured out a cause?

The calendar shows the word 'true' instead of an actual calendar

share|improve this question
    
I'm having the same issue in my solution, which still doesn't exist in a production environment. So, either if I spend quite a while without accessing my deployed app, or if I make a new deployment, then, the first time I'll click a SharePoint:DateTimeControl it has like a 1/4 chance of taking quite a while to load, in which case it will usually display this "true" box instead of the calendar. My master is about the same as v4.master, with just a few extra divs and an ul/li menu. Any suggestions are welcome –  user16484 Apr 19 '13 at 13:46
    
I ended up using a script link to add jquery to all the pages on my sites to just use jquery date pickers instead of the junky sharepoint ones. If I remember, I'll provide an example on Monday. –  Craig Apr 19 '13 at 20:29
add comment

4 Answers

up vote 2 down vote accepted

It seems this is a timing issue and may be exacerbated by network slow down. This control issues an ajax call back to the server and if the response takes more than a second to come back, that gives the user a chance to click a 2nd time on the icon (issuing a 2nd ajax call). Whent the calendar pops up (with the div), the javascript gets confused and only closes the calendar and NOT the div as well. It's probably a parent/child issue since the div is probably opened with the 1st request and the calendar was created by the 2nd click request.

You can reproduce the issue very easily if you can catch your network when it's relatively slow. You just have to click the icon a 2nd time before the calenar pops up. THen when the calendar pops up and you select a date, you will see the problem. I found that sometimes you have to triple click, but I could easily replicate it.

As a work around, you should be able to add javascript to the page that disables the calendar icon/button in the 'onclick' event (to prevent people from clicking that 2nd time), then when the response comes back, re-enable the icon/button.

share|improve this answer
    
Thanks for the answer! We never were sure what had caused this. It seemed to happen usually on our (slow) test server, and even then, usually after an IIS reset. Now we know why! –  Craig Nov 12 '13 at 13:13
add comment

I still haven't found why this happens sometimes, but I've found that the best solution is to just replace SharePoint's obsolete datepicker with the one from jQuery-ui. You can do this with a Script Link feature:

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({
            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(); });
    }
}
share|improve this answer
add comment

If you are using a custom master page then I would try switching the site back to v4.master and then retesting just this functionality. If it is suddenly resolved then it means that something in your custom javascript is interfering with the SharePoint scripts.

Custom solutions that inject custom controls into delegates is another place to check but those are pretty rare.

share|improve this answer
add comment

This might be too late to help you guys but if your master page sets the compatibility to IE8 then this should solve your problem. It seems to mess up with anything above.

EDIT: It actually seems to only mess up with IE 11

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.