简体   繁体   English

jquery-ui DatePicker 按钮消失

[英]jquery-ui DatePicker Button disappears

Yesterday I attempted to ask a question why my jquery-ui Datepicker code wasn't working, I am going to try again, this time with a bit more description, because I really am lost, the exact same code was working two days ago, and I don't know what happened.昨天我试图问一个问题,为什么我的 jquery-ui Datepicker 代码不起作用,我要再试一次,这次有更多的描述,因为我真的迷路了,两天前完全相同的代码还在工作,我不知道发生了什么。

I use the Jquery UI datePicker.我使用 Jquery UI datePicker。 I have it in my site to prevent users from entering in dates that don't make any sense or are not formatted correctly, or perhaps are just simply formatted the wrong way.我在我的站点中有它,以防止用户输入没有任何意义或格式不正确的日期,或者只是格式错误。 I put the appropriate jquery libraries into my project master page... like so...我将适当的 jquery 库放入我的项目母版页中......就像这样......

    <link rel="stylesheet" type="text/css" href="../../Content/jqUIcss/jquery-ui-1.8.14.custom.css" />      
    <script type="text/javascript" src="../../Scripts/jquery-1.5.1.min.js"></script>
    <script type="text/javascript" src="../../Scripts/jqUI/jquery-ui-1.8.14.custom.min.js"></script>
    <script src="../../Scripts/jqUI/jquery.ui.datepicker.js" type="text/javascript"></script> 

I have a text box that I try and link to a datepicker instance, like so...我有一个文本框,我尝试链接到 datepicker 实例,就像这样......

    ><%=Html.TextBox(string.Format("{0}", paths[i]), (row.Contains("Date") ? nodes["value"].Value : row), new { @class = "datepicker"+dateCount })%>

and finally, I have some code, that will supposedly invoke this whole thing (jquery code of course)...最后,我有一些代码,据说会调用整个事情(当然是jquery代码)......

    $(document).ready(function () {

    $(".datepicker0").datepicker({
        showOn: 'both',
        dateFormat: 'dd M yy',
        changeMonth: true,
        changeYear: true,
        changeDay: true
    });

I am completely stumped?我完全被难住了? Why would this stop working all of a sudden?为什么这会突然停止工作? Now, I did make some changes to how I rendered my form to the page, I changed it from a one column table that listed all the elements, to a that is delimited by paragraphs.现在,我确实对将表单呈现到页面的方式进行了一些更改,我将其从列出所有元素的单列表更改为由段落分隔的表。 Why on Earth would that stop it from working?为什么这会阻止它工作呢? And to prove that I am not crazy (well, its not really proof, but its anecdotal) the datepicker on my other page has stopped working as well, and I did not change one frigging thing on that page... I am absolutely confounded, and I don't know where to beggin to solve this?为了证明我没有疯(好吧,这不是真正的证据,但它的轶事)我另一页上的日期选择器也停止了工作,而且我没有改变那个页面上的一件令人毛骨悚然的事情......我绝对感到困惑,我不知道从哪里开始解决这个问题? Has anyone else experienced this problem?有没有其他人遇到过这个问题? What could be possible causes and most importantly how can I resolve this so that it doesn't happen again?可能的原因是什么,最重要的是我该如何解决这个问题,以免它再次发生? Is there a way that I can just get the calendar to pop up by clicking inside the text box area?有没有一种方法可以通过在文本框区域内单击来弹出日历?

Yes, it's a well known bug.是的,这是一个众所周知的错误。 You should copy and paste the CSS code from the JQuery UI in the demo they use, and replace the code with your code.您应该在他们使用的演示中复制并粘贴 JQuery UI 中的 CSS 代码,并将代码替换为您的代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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