• New Commercial Services Section

    We have now opened a commercial services section here on the forum. If you have a Fabrik project that you wish to have someone work on for you, post it under Help Wanted. If you are an application developer and wish to earn some money helping others, post your details under Fabrik Application Developers.

    Both of these are unmoderated. It will be up to both parties to work out the details and come to an agreement.

Setting one date depending on an other

  • Views Views: 2,242
  • Last updated Last updated:
  • Date element's Javascript:
    Select "Event" = change
    In "Javascript code" field add
    Code:
    /*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);
Back
Top