1

I have the folowing code which allows to pick date from calendar. How to make it unable to pick dates from past today?

    echo form_label(lang("arrival_date"), 'tdata');
    ?>

    <div class="input-group date form_date col-md-5" data-date="" data-date-format="yyyy-mm-dd" data-link-field="dtp_input2" data-link-format="yyyy-mm-dd">
        <input name="tdata" id="tdata" class="form-control" size="16" type="text" value="<?php echo set_value('tdata') === null ? set_value('tdata') : isset($this->session->userdata['step_1']['tdata']) ? $this->session->userdata['step_1']['tdata'] : set_value('tdata'); ?>" readonly>
        <span class="input-group-addon"><span class="glyphicon glyphicon-remove"></span></span>
        <span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>
    </div>
   <input type="hidden" id="dtp_input2" value="" />
Aleksandr
  • 33
  • 4
  • 4
    Possible duplicate of [how to restrict bootstrap date picker from future date](http://stackoverflow.com/questions/20964218/how-to-restrict-bootstrap-date-picker-from-future-date) – JimL May 29 '16 at 15:00
  • I think you can set a max value on the input in html, although you will still need to validate server side. – Jeff Puckett May 29 '16 at 15:01

0 Answers0