Viewing 3 replies - 1 through 3 (of 3 total)
  • 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() {
    jQuery(“#checkin”).datepicker({
    dateFormat: ‘yy/mm/dd’,
    minDate: new Date(),
    onSelect: function() {
    jQuery(“#checkout”).datepicker(‘option’,’minDate’,jQuery(“#checkin”).datepicker( “getDate” ));
    }
    });
    jQuery(“#checkout”).datepicker({
    dateFormat: ‘yy/mm/dd’,
    minDate: new Date()
    });
    });
    </script>
    <?php

    I tried with the above code but it does’t work . The page gets crash.

    I added code into functions.php under wp-content\plugins\contact-form-7\includes location

    Is it correct what I did ?

    Thank you mrina(@mrina-1) for the code.

    Provide id to date field
    [date* depature-date id:checkin]

    Keep the below code in theme functions.php

    add_action(‘wp_head’, ‘ativa_data’);
    function ativa_data(){
    ?>
    <script type=”text/javascript”>
    jQuery(function() {
    jQuery(“#checkin”).datepicker({
    dateFormat: ‘yy/mm/dd’,
    minDate: new Date()
    });
    });
    </script>
    <?php }

    And it works perfectly fine.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘how to disable past date?’ is closed to new replies.