TOPIC:

How to set Responsive calendar min-variable dynamically 9 months 4 weeks ago #237696

  • Joe Cool's Avatar Topic Author
  • Joe Cool
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 64
  • Thanks: 0
Hello,
I found all the adjustments hints for the responsive calendar, very nice.
But I need to set the min-date of my "departure-calendar-field" to be the date value +1 of the "arrival-calendar-field".
I can't get it to work. My attempt was this:
// "ARRIVAL Calendar Element"
    JQuery("#ff_elem9509_calendarButton").pickadate({
        format: "dd.mm.yyyy",
        editable: false,
        selectYears: 2,
        selectMonths: true,
        firstDay: 1,
        min: 3,
        max: 365,
        onSet: function() {JQuery("#ff_elem9509").val(this.get("value"));}
    });
// "DEPARTURE Calendar Element"
    JQuery("#ff_elem9510_calendarButton").pickadate({
        format: "dd.mm.yyyy",
        editable: false,
        selectYears: 2,
        selectMonths: true,
        firstDay: 1,
        min: function() {JQuery("#ff_elem9509").val();},
        max: 365,
        onSet: function() {JQuery("#ff_elem9510").val(this.get("value"));}
    });

Does anyone have an idea, how to solve this? I want the departure date to be limited to Arrival + 1, so no wrong dates can be entered.

THX
If SIN= "true" goto HELL;
else goto HEAVEN;

Please Log in or Create an account to join the conversation.

How to set Responsive calendar min-variable dynamically 9 months 4 weeks ago #237703

  • mihaela
  • Offline
  • Developer
  • Developer
  • Posts: 3128
  • Karma: 105
  • Thanks: 413
Hello,

You can try to use this solution crosstec.org/en/forums/15-usage/116892-d...nd-after.html#201745 which will work what you want. put the suggested code in the initialization script.
In order for that example to work, the names of the responsive calendar have to be "arrival" and "departure".

Note that in that case, the calendar will look a bit different. You will see how it looks when you test it.
This way the person filling in the form won't be able to select departure date before the arrival date

The other option would be to add validation to the calendar element so that, when clicking on the submit button, if the departure date is not after the arrival date an error message will appear. User will have to change that in order to be able to submit the form.
Here you can take a look at an example code for a validation code crosstec.org/en/forums/1-forums/125424-c....html?start=6#232597 .

Let me know whether this helped and whether you have managed to set it for your form.

Regards,

Mihaela

Please Log in or Create an account to join the conversation.

Last edit: Post by mihaela.
  • Page:
  • 1
Moderators: ForumSupport
Time to create page: 0.037 seconds

July Sale!

Discounts for all of our extensions + support. Ending July 31st!

Get Your Subscription Here

Quick Links

Downloads

BreezingForms

ContentBuilder

BreezingCommerce

Templates

Documentation

BreezingForms

ContentBuilder

BreezingCommerce

Apprendre BreezingForms (French Community)

Apprendre et maîtriser BreezingForms par des tutoriels et exemples, le tout en français

breezingforms.eddy-vh.com

Questions et réponses sur les forums de l'AFUJ

AFUJ

Special Offer

Summer Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!