Jquery Datepicker 不工作,从查询站点复制代码
我有以下代码。我的印象是日期选择器将通过 ID 连接到表单,但目前它根本没有显示在页面上。任何帮助都会很棒。
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>
I have the following code. I am under the impression that the date picker would be connecting to the form by ID, but currently it doesn't show up on the page at all. Any help would be great.
SCRIPT *updated code / still not working
<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>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将 Jquery 链接更改为
因为我使用的是 WordPress,所以我忘记了我需要以不同的方式路由到我的 js 文件夹,但这效果更好。
Changed the Jquery links to
Since I am using wordpress I forgot I needed to route to my js folder differently this works better though.