samedi 3 août 2019

Bootstrap Datepicker Validations Not Working

I want to validate the datepicker input control to disable all past dates, i.e all dates from the current date only should be enabled.

I tried using the bootstrap-datepicker library and used the js code below for the validation but I'm still able to select all past dates.

$('.input-group.date').datepicker({
        autoclose: true,
        daysOfWeekDisabled: [0, 6],
        todayHighlight: true,
        format: "dd-mm-yyyy",
        startDate: '30-07-2019'
        });

<form action="#" method="POST">

    <div class="input-group date">
        <input type="text" class="form-control">
    </div>

    <button type="submit" id="submit">Submit</button>

</form>

     <script src=""></script> 
<link rel="stylesheet" href=""> 

I want all past dates to be disabled.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire