• Resolved thebiganswer

    (@thebiganswer)


    Hi all,

    Just a quick share. Full credit goes to here… http://stackoverflow.com/questions/2193169/jquery-ui-datepicker-ie-reload-or-jumps-to-the-top-of-the-page

    In short, let’s say you’re using the jQuery date picker (possibly in your WordPress admin console) and it’s working fine in Firefox et al. However, when you try to select a date in IE (Internet Explorer) the focus jumps to the top of the page and the field is empty (i.e. nothing happened apart from jumping away from where you were).

    A solution (not necessarily the best nor most advised, but one that works) is to add the following to your Javascript Date Picker initialisation script/code block:

    $("#id-of-your-date-picker-element").datepicker({ onSelect: function() { $(".ui-datepicker a").removeAttr("href"); } });

    What does this do? It simply strips the ‘href’ attribute from the anchor tag (<a>).

  • The topic ‘Solution To IE jQuery Date Picker Jumps To Top Of Page’ is closed to new replies.