Jquery Datepicker 不工作,从查询站点复制代码

发布于 2025-01-06 09:13:22 字数 1061 浏览 4 评论 0原文

我有以下代码。我的印象是日期选择器将通过 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

坠似风落 2025-01-13 09:13:22

将 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 文件夹,但这效果更好。

Changed the Jquery links to

<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>

Since I am using wordpress I forgot I needed to route to my js folder differently this works better though.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文