从Bootstrap timepicker发送带有$ _GET的值

时间:2014-10-09 08:01:32

标签: javascript php jquery twitter-bootstrap

我试图用$ _GET从Bootstrap-timepicker发送值,但我在javascript中的编码并不是最好的。我只在stackoverflow上发现了一个类似的问题,但我仍然无法让它工作。 Bootstrap Datepicker - How to send value to URL?。我只是想在提交表单时在URL中获取timepicker值

以下是我的一些代码。提前致谢

<form name="search" action="" method="GET">
    <div id="end-datetimepicker">
        <div class="input-group input-group-xs color-gray">
            <input data-format="yyyy-MM-dd" type="text" class="gray-border"></input>
                 <i class="input-group-addon add-on"><span class="glyphicon glyphicon-calendar"></span></i>
        </div>
        <script text="javascript">
            $('#end-datetimepicker').datepicker().on('changeDate', function() {
               $(this).parent('form').submit();
            });
        </script>
    </div>
    <input type="submit" value="search" class="btn btn-small costom-search-button">
</form>

    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
    <!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="js/bootstrap.min.js"></script>
<script type="text/javascript"src="http://tarruda.github.com/bootstrap-datetimepicker/assets/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript"src="http://tarruda.github.com/bootstrap-datetimepicker/assets/js/bootstrap-datetimepicker.pt-BR.js"></script>

<script type="text/javascript">

     $(function() {
         $('#start-datetimepicker').datetimepicker({
            pickTime: false,
            language: 'sv'
         });
     });

    ...       

    $(function() {
         $('#end-datetimepicker').datetimepicker({
             pickTime: false,
             language: 'sv'
         });
     });

    ...

</script>

0 个答案:

没有答案