Thursday, May 17, 2012

JQuery DatePicker in IE Security

Here's a quick tip.  I was recently trying to implement a JQuery UI Datepicker on a site and I couldn't get the events to fire in IE8 when selecting a date.  If you Google JQuery Datepicker IE, you'll find a ton of issues - it took me a long time to figure out my actual solution though.  I was working in a Win Server environment, and finally decided that if the JQuery example code page worked fine in my host laptop running Win7, it must be related to the server.  Sure enough, WinServer has tighter internet security than a your home Windows OS by default.  I finally found this bug report which led me to the solution.  Even though I was developing on an Intranet / Trusted site, the security settings that were being invoked by IE were from an Internet Site level.  You can follow the fix in the link above, or my fix was to simply open IE as an Admin and allow scripting on Internet Sites.  As soon as I did that, the datepicker started behaving like normal in IE.