Guest User

Untitled

a guest
Nov 24th, 2017
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.80 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="es">
  3. <head>
  4. <meta charset="UTF-8">
  5. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.css">
  6. <script src="http://momentjs.com/downloads/moment.min.js"></script>
  7. <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
  8. <script src="https://code.jquery.com/jquery-1.12.4.js"></script>
  9. <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
  10. <script type="text/javascript">
  11. $(function() {
  12. $("#check_in").datepicker({
  13. onSelect: function(dateStr) {
  14. var minDate = $(this).datepicker('getDate');
  15. if (minDate) {
  16. minDate.setDate(minDate.getDate() + 1);
  17. }
  18. $('#check_out').datepicker('setDate', minDate).
  19. datepicker('option', 'minDate', minDate);
  20. }
  21. });
  22.  
  23. $('#check_out').datepicker().on("input click", function(e) {
  24. console.log("Fecha salida cambiada: ", e.target.value);
  25. });
  26. });
  27. </script>
  28. </head>
  29. <body>
  30. <form action="<?php echo $_SERVER['PHP_SELF'];?>" name="mibusqueda" id="mibusqueda" method="POST">
  31. <label for="check_in">Entrada:</label>
  32. <input type="text" placeholder="Fecha de entrada" name="check_in" id="check_in" value="<?php if(isset($_POST['check_in'])){ echo $_POST['check_in']; }?>">
  33.  
  34. <label for="check_out">Salida:</label>
  35. <input type="text" placeholder="Fecha de salida" name="check_out" onchange="calculoNoches();" id="check_out" value="<?php if(isset($_POST['check_out'])){ echo $_POST['check_out']; }?>">
  36. </form>
  37. </body>
  38. </html>
Add Comment
Please, Sign In to add comment