Contact Form 7 Datepicker
Check-in and Check-out interaction for min-date (3 posts)

  1. Petr Vujtech
    Posted 2 years ago #

    Hi, I would like to use this awesome calender for hotel booking.
    Lets have two inputs Check-in and Check-out.
    For check-in I can set min-date:0 (means booking available from today). For check out I need to set min-date equal to the value of Check-in + 1day.

    Similar function is here http://www.eyecon.ro/bootstrap-datepicker/ but I like more contact form 7 calendar.

    Any solution for this issue ?


  2. pauloluft
    Posted 1 year ago #

    I do not quite understand. You want dates before checkin stay locked?
    See this example:

    Create inputs with id checkin and checkout:
    Exemplo contact form 7:
    [text date-go id:checkin]
    [text date-back id:checkout]

    Put it in the functions.php file:

    add_action('wp_head', 'ativa_data');
    function ativa_data(){
    	<script type="text/javascript">
    		jQuery(function() {
    				dateFormat: 'yy/mm/dd',
    				minDate: new Date(),
    				onSelect: function() {
    					jQuery("#checkout").datepicker('option','minDate',jQuery("#checkin").datepicker( "getDate" ));
    				dateFormat: 'yy/mm/dd',
    				minDate: new Date()
  3. andrew_punkle
    Posted 1 year ago #

    Hey paulo,

    I tried your method but it wasn't quite working for me, which is probably me miss placing some code. I understand placing the

    add_action... at the end of the functions.php file, but the

    [text date-go id:checkin]
    [text date-back id:checkout]

    where exactly are you placing those? I already have an existing form and when I replace the

    [date arrivaldate 20/]
    [date departuredate 20/]

    no calendars pop up, any suggestions?

    Thank you

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Contact Form 7 Datepicker
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic