Monday, April 3, 2017

how to disable the selected date in laravel

i have start-date and end-date, when i click start date, all current date before should disable, so i can select only current date and after. And when i click end-date, the date which i select in start-date that before date should be disable, so i can only select only after start-date.

laravel code:

$this->col = [];
            $this->col[] = ["label"=>"Startdate","name"=>"startdate"];
            $this->col[] = ["label"=>"Enddate","name"=>"enddate"];
            $this->col[] = ["label"=>"Doctor","name"=>"doctor","join"=>"doctor,fname"];
            # END COLUMNS DO NOT REMOVE THIS LINE

            # START FORM DO NOT REMOVE THIS LINE
            $this->form = [];

            $this->form[] = ['label'=>'Startdate','name'=>'startdate','type'=>'datetime','validation'=>'required|date_format:Y-m-d H:i:s','width'=>'col-sm-7'];
            $this->form[] = ['label'=>'Enddate','name'=>'enddate','type'=>'datetime','validation'=>'required|date_format:Y-m-d H:i:s','width'=>'col-sm-7'];
            $this->form[] = ['label'=>'Doctor','name'=>'doctor','type'=>'select','validation'=>'required|min:1|max:255','width'=>'col-sm-7','datatable'=>'doctor,fname'];

please help me, i am new in laravel and i am college student



via kinzang

Advertisement