1. Fabrik 3.9 has been released. If you have updated Joomla to 3.9, this is a required update.
    Dismiss Notice

Setting one date depending on an other

Apr 12, 2020
Setting one date depending on an other
  • Date element's Javascript:
    Select "Event" = change
    In "Javascript code" field add
    Code (Text):
    /*On change of from_date (=this element) set to_date  2 days after.
    termin_reservation___bis = full element name of to_date, form_18 = your form id
    */
    var to_date_id = 'termin_reservation___bis';
    var to_date = Fabrik.getBlock('form_18').formElements.get(to_date_id);
    var from_date = this.get('value');
    var newDate = new Date(from_date);
    newDate.increment('day', 2);
    to_date.set(newDate);