1

嘿,任何想法为什么这不起作用,当我点击输入字段时,什么也没有发生。这是代码:

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript" src="js/ui.datepicker.js"></script>
<script type="text/javascript" charset="utf-8">
            $(function()
            {
                $('.date-pick').datePicker();
            });
        </script>

这是我的表格:

<form id="form1" name="form1" method="post" action="chart.php">
    <ul id="add_form">
            <li><label>Date from</label>
             <input type="text" name="date1"  class="date-pick" /></li>
            <li><label>Date to</label>
             <input type="text" name="date2"  class="date-pick" value="<?php echo date("Y-m-d") ?>" /></li>
            <li><label>Display</label>
            <select name="type">
              <option value="1">User Joins</option>
              <option value="2">Messages sent</option>
              <option value="3">Optin/outs</option>
            </select>
            </li>
            </ul>
            <br clear="all" /><br />
           <input type="image" src="images/show.jpg" border="0" alt="Submit Form" class="login" />
    </form>
4

3 回答 3

0

To me it seems that you want...

$('.date-pick').datepick();

But I'm looking at the 3.7.4 version of Datepicker (freshly downloaded from the jQuery site). Based on your element that imports the Datepicker plugin, I'm not sure we're looking at the same version.

My example works for me using your markup.

于 2010-01-07T17:37:52.997 回答
0

我想你想要一个小写的 p。

$('.date-pick').datepicker();
于 2010-01-07T17:15:48.610 回答
0

您是否包含 jQuery.ui.core js 文件?

您是否包含 DatePicker CSS 文件(ui.core.css 和 ui.datepicker.css)?有时它可以工作,但您看不到它应有的样子,因为没有适当的样式。

于 2010-01-07T17:44:48.650 回答