0

I´am trying to send the values from the Bootstrap-timepicker with $_GET but my coding in javascript is not the best. I only found one similar question on stackoverflow but I still can´t get it to work. Bootstrap Datepicker - How to send value to URL? . I just want to get the timepicker values in the URL when the form is submitted

Here is some of my code. Thanks in advance

<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>
Community
  • 1
  • 1
user3800924
  • 407
  • 1
  • 3
  • 17
  • 1
    Your input field is missing a `name` attribute. Without it, theres no data to send. Additionally, you have some unquoted JS; ( `$(#end-datetimepicker)` ) – Repox Oct 09 '14 at 08:08
  • Ohh yeah it was that easy :) my bad. Thank you :) – user3800924 Oct 09 '14 at 08:30

0 Answers0