1. Important notice about Cloudbleed - if your site uses the Cloudflare CDN, and you intend to follow the Joomla security team's advice to change your site "secret", you MUST READ THIS NOTICE.
  2. Fabrik 3.6 Released Remember to backup and test your backup before proceeding with this update. Please report any problems you might experience with this new version here on the forum. You are safe to upgrade to Joomla! 3.7 and PHP 7.x with this version of Fabrik. View the blog for more details on this release.

Date Elements Allow Dates JS

Discussion in 'Professional Support' started by joomlamate, Oct 24, 2016.

  1. joomlamate

    joomlamate Member

    Level: Professional
    I have 2 date element fields - start/end Date.

    I am trying to use the JS Allow Dates so to restrict Min/Max dates when a date is selected in any of these fields.

    Is there any way to catch the Date Selection of the other date field inside the field that has to be adjusted on its allowed dates?

    What event could be used for this?
     
  2. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Supporter
    Yeah, you should be able to get the other element's value with ...

    Code (Text):

    var otherDate = Fabrik.getBlock('form_X').formElements.get('yourtable___otherdate').getValue();
     
    Replace X with your numeric form ID, and yourtable___otherdate with the full element name of ... well, the other date.

    Actually, you might be able to use this.form instead of Fabrik.getBlock('form_X').

    -- hugh
     

Share This Page