Bootstrap Datepicker - How to send value to URL?

前端 未结 1 1572
情歌与酒
情歌与酒 2021-01-17 02:33

I must admit I\'m hopeless on Javascript, PHP is more in my comfort zone.

I\'m trying to use Bootstrap Datepicker for a booking system. I\'m trying to find a way tha

相关标签:
1条回答
  • 2021-01-17 02:43

    You should just have it in a form with method set to GET, and then submit the form on date change:

    <form action="test.php" method="GET">
        <input id="date" name="date">
    </form>
    
    <script>
       $('#date').datepicker().on('changeDate', function() {
             $(this).parent('form').submit();
       });
    </script>
    
    0 讨论(0)
提交回复
热议问题