2012-02-18 37 views
0

我有以下代码。我的印象是日期选择器将通过ID连接到表单,但目前它并未显示在页面上。任何帮助都会很棒。Jquery Datepicker不工作,从查询站点复制代码

SCRIPT *更新的代码/仍然没有工作

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> 
<script src="js/jquery-ui-1.8.17.custom.min.js"></script> 
<script> 
    $(document).ready(function() { 
     $("#datepicker").datepicker({ minDate: -20, maxDate: "+1M +10D" }); 
    }); 
</script> 

FORM

<form method="post"> 
      <li><label for="test">Question 01</label><input type="text" id="datepicker" name="test" value="" /></li> <!-- the (name="test") value is what the ('responses' => $_POST["test"]) value is talking too --> 

      <li><input name="submit" type="submit" id="submit" class="submit button" value="Send feedback" /></li> 
      <?php wp_nonce_field('updateFeedback'); ?> 
      <input name="action" type="hidden" id="action" value="updateFeedback" /> 
</form> 
+0

你是想连接jQuery而不是连接两次jQuery UI?这只是一个错字或者是你的来源吗? – Archer 2012-02-18 02:16:59

+0

另外,你有没有在jQuery UI之前包含jQuery本身? – 2012-02-18 02:20:19

+0

你可以发布你的整个标题?脚本的页面顶部。正如你可以看到你的代码在这里工作得很好:http://jsfiddle.net/FWbnH/它可能是你如何设置你的页面。 – 2012-02-18 02:33:18

回答

0

改变了Jquery的链接

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> 
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js"></script> 

自从我使用WordPress的我忘了,我需要的路线到我的js文件夹不同,但这种方式效果更好。