简体   繁体   中英

jQuery Date Picker Issue

I have a situation where the jQuery date picker not working in one of the IE (it work perfectly fine in other IE with same version).

When user select on the date picker, the calendar come out as a drop down, but the date is not able to select and also unable to select other months .

The code as below:

<script src="../../../JS/jquery-1.5.2.min.js" type="text/javascript"></script>
<script src="../../../JS/jquery-ui-1.8.11.custom.min.js" type="text/javascript"></script>
<script type="text/javascript">
    $(document).ready(function() {
        $("#<%=txtDate.ClientID %>").datepicker({ defaultDate: +0, showOn: 'button', buttonImage: 'calendar.gif', buttonImageOnly: true, dateFormat: 'dd/mm/yy' });
    });
</script>

<asp:TextBox ID="txtDate" runat="server" AutoPostBack="true" Width="115px" MaxLength="10"></asp:TextBox>

在此处输入图片说明

could this due to the setting of IE? please help.

thank you in advanced.

UPDATE

  • try to switch between document mode and browser mode in IE, but not able to solve the problem

  • try script debugging in IE developer tool, no error found.

I believe that your selector is not rendered correctly

try this: separating rendering of js variable away from selector:

<%=string.Format("var datepicker=#{0}",txtDate.ClientID) %>

 $("#"+datepicker).datepicker({ defaultDate: +0, showOn: 'button', buttonImage: 'calendar.gif', buttonImageOnly: true, dateFormat: 'dd/mm/yy' });

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM