0

am trying to get a reservation form for my project so i code this :

<form action="#" method="POST">
                <div class="form-row">
                    <div class="form-group col-md-2">                           
                        <label for="In"><i class="far fa-calendar-plus"></i> CheckIn</label>
                        <input type="date"  class="form-control" id="In" name="checkIn">
                    </div>
                    <div class="form-group col-md-2">
                        <label for="Out"><i class="far fa-calendar-plus"></i> Depart</label>
                        <input type="date" class="form-control" min="<?php minDate() ; ?>" id="Out" name="checkOut">
                    </div>
                </div>  
            </form>

then i call the function minDate() in the CheckOut input min="<?php minDate() ; ?>" attribute in order to hide the dates less then the CheckIn date

this is the function :

 function minDate(){

    if(isset($_POST['checkIn'])){

        $date = $_POST['checkIn'];  

    }

    echo $date;
}

but this is not working , the dates less then the check in date didn't hide

can i get some help !_!

0 Answers0