0

我对javascript/jquery知之甚少,我试图使用html/php/mysql使用pickadate.js-3.5.3传递日期我需要从pickadate.js-3.5.3日期函数中获取用户输入的日期并转换它转换为 MYSQL 中 DATE 数据类型的格式

这是我到目前为止的代码;

<p id="datepairExample">Date:<input class="fieldset__input js__datepicker" name="datepicker1" value="" type="text" placeholder="Date"> </p><br/>

   <script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>

   <script src="dt/js/legacy.js"></script>
    <script src="dt/js/picker.js"></script>
    <script src="dt/js/picker.date.js"></script>
    <script src="dt/js/picker.time.js"></script>
     <script>window.jQuery||document.write('<script src="pickadate.js-3.5.3/tests/jquery.2.0.0.js"><\/script>')</script>
    <script src="dt/demo.js"></script>

我已经阅读了有关如何执行此操作的文档,甚至尝试将演示中的代码复制并粘贴到我自己的页面中,但没有成功!欢迎任何建议!谢谢

4

1 回答 1

2

http://amsul.ca/pickadate.js/date.htm#formats

更新数据 2 2

<link rel="stylesheet" href="lib/themes/default.css" id="theme_base">
<link rel="stylesheet" href="lib/themes/default.date.css" id="theme_date">
<link rel="stylesheet" href="lib/themes/default.time.css" id="theme_time">

<!--[if lt IE 9]>
    <script>document.createElement('section')</script>
<![endif]-->


<body>

<form>
   <input class="datepicker" name="datepicker1" type="text" placeholder="Try me&hellip;">

   <input type="submit" />
</form>  




    <script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
    <script>window.jQuery||document.write('<script src="tests/jquery.2.0.0.js"><\/script>')</script>
    <script src="lib/picker.js"></script>
    <script src="lib/picker.date.js"></script>
    <script src="lib/picker.time.js"></script>


    <script>

        $(function() {
            $('.datepicker').pickadate({
                formatSubmit: 'yyyy-mm-dd',
                hiddenName: true
            })    
        });

    </script>

</body>
于 2014-11-29T14:04:45.510 回答