wright67uk Posted January 12, 2013 Share Posted January 12, 2013 This code works well in firefox and chrome, but in IE I have just a blank box and nothing happens when I click in the box. Can you tell my why this isnt working in IE? (tested on IE.9) <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js" type="text/javascript"></script> <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.14/jquery-ui.min.js" type="text/javascript"></script> <script> (function() { var elem = document.createElement('input'); elem.setAttribute('type', 'date'); if ( elem.type === 'text' ) { $('#date').datepicker({ dateFormat: 'dd-mm-yy', // defaultDate: +5 maxDate : +3 }); } })(); </script> </head> <body> <form> <input type="date" name="date" id="date" value=" " /> </form> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/273053-my-jquery-datepicker-isnt-working-in-ie/ Share on other sites More sharing options...
Christian F. Posted January 12, 2013 Share Posted January 12, 2013 What does the error console say? Quote Link to comment https://forums.phpfreaks.com/topic/273053-my-jquery-datepicker-isnt-working-in-ie/#findComment-1405137 Share on other sites More sharing options...
wright67uk Posted January 12, 2013 Author Share Posted January 12, 2013 I'm a bit new to this, but I've gone into the page were talking about in ie and pressed f12, I've gone through the various tabs, profiling and debugging buttons and I can't find any errors. I've also tried Tools >> Internet Options >> Advanced Tab >> Browsing >> Check the "Display a notification about every script error" checkbox. Quote Link to comment https://forums.phpfreaks.com/topic/273053-my-jquery-datepicker-isnt-working-in-ie/#findComment-1405200 Share on other sites More sharing options...
Christian F. Posted January 12, 2013 Share Posted January 12, 2013 Afraid I can't help you with this one then, you'll have to wait for someone that has access to IE. Quote Link to comment https://forums.phpfreaks.com/topic/273053-my-jquery-datepicker-isnt-working-in-ie/#findComment-1405206 Share on other sites More sharing options...
MDCode Posted January 12, 2013 Share Posted January 12, 2013 (edited) A quick google of the subject results in this being a common problem. However, most people report that it is a problem with either: 1) Compatibility mode being turned off or 2) Running the 32-bit version instead of the 64-bit Edited January 12, 2013 by SocialCloud Quote Link to comment https://forums.phpfreaks.com/topic/273053-my-jquery-datepicker-isnt-working-in-ie/#findComment-1405208 Share on other sites More sharing options...
nogray Posted January 12, 2013 Share Posted January 12, 2013 You should put your code in the ready function, onload function or in the bottom of document. You are trying to access the HTML elements before they are created. Quote Link to comment https://forums.phpfreaks.com/topic/273053-my-jquery-datepicker-isnt-working-in-ie/#findComment-1405209 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.