Buy Now
Sign in

CF6, how do I set a calendar starting date based on the user nput in another calendar field?

zingales , May 24 2017, 22:09
Z
zingales 54
May 24 2017, 22:09 #368577
Hi!
I have a check in and checkout calendar fields in a hotel reservation form.
I want to dynamically set the start date of the check out at least after the date the user has choosen in the checkin calendar.
A bonus would be to set the checkout start date a few days AFTER the user provided checkin date.
So if the user sets as checkin date 25-12-2017 the selectable dates in he checkout calendar field should start after the checkin date or better a few days (after the checkin date to set a minimum number of nights per stay).

Is it possible to calculate a date difference - expressed in days- and set it in another field, so it would be shown in the email sent by the form?

Is there a syntax guide or a manual for crhonoforms 6?
thanks in advance.
admin 27
May 25 2017, 06:37 #368582
Hi zingales,

The "Advanced" tab of the calendar element has a start and end calendar fields, set the "start calendar" field in the "2nd calendar" field to this:

#id_of_first_calendar


if you want to add few days then you need to use the "Function" event.

Best regards,
Max
Max
If your main question got answered then please mark the answer using the button!
Please let us know if you have any problems with the new forums text editor, we appreciate your feedback!
Z
zingales 54
May 25 2017, 13:38 #368615
that's great, but it's just part of the answer.

As many other users here already asked: WHERE IS THE MANUAL?
Where are the DOCS about the syntax?

You kindly answer users questions in the forum, but there would be much less or no questions with a manual.
I beg you pardon if I'm wrong, but I didn't found it.

thanks in advance,
admin 27
May 25 2017, 16:49 #368631
Hi Zingales,

i'm trying to have a manual up as soon as possible, but its still not yet ready.

What are the topics you want to have in the manual first ?

Best regards,
Max
Max
If your main question got answered then please mark the answer using the button!
Please let us know if you have any problems with the new forums text editor, we appreciate your feedback!
P
phoenix89r 5
February 21 2019, 14:51 #384054
Hi Max !
I have 2 calendar fields.
I want to dynamically set the startdate of the second calendar after 15 days the date the user has choosen in the first calendar.
I've set #id_of_first_calendar in the "Start calendar" of the "Advanced" tab of the second calendar;
I've set a "Function" event in the first calendar, but I don't understand what is the right syntax of value to use in it. Can you help me?
thanks in advance.    
admin 27
March 10 2019, 19:40 #384628
Hi phoenix,
I just read this now!
You can set the first calendar field to "reload" the 2nd calendar field, and pass the value of the first calendar field to the "Earliest date" field of the 2nd when its reloaded using {data:first_calendar_name}
Pay attention to have the same "real format" setting in both fields!
Best regards
Max
If your main question got answered then please mark the answer using the button!
Please let us know if you have any problems with the new forums text editor, we appreciate your feedback!
P
phoenix89r 5
March 20 2019, 12:42 #385087
Hi Max,
I passed the value of the first calendar field to the "Earliest date" field of the 2nd using {data:first_calendar_name}, but I need that the "Earliest date" starts 15 days after the data set in the first calendar.
So I need ad expression in "Earliest date" that give me ( {data:first_calendar_name}+15days) but I don't no what is correct syntax.
thanks in advance.   
D
Dsign 29
April 13 2019, 18:41 #385920
Same problem here Max!
I got 2 calendars and the date of the second calendar needs to be a +30 days later.
admin 27
April 13 2019, 19:38 #385924
Hi,
You can try this:
{date:(data:first_calendar_name)$+30days}
Best regards
Max
If your main question got answered then please mark the answer using the button!
Please let us know if you have any problems with the new forums text editor, we appreciate your feedback!
D
Dsign 29
April 13 2019, 19:55 #385925
Still not working
On Avanced of CALENDAR-2
Earliest date/time
{date:(data:CALENDAR-1_ID)$+30days}
Start calendar
#CALENDAR-1_ID
... What am i missing here?
admin 27
April 14 2019, 14:42 #385947
You need to use the first calendar name not id!
Best regards
Max
If your main question got answered then please mark the answer using the button!
Please let us know if you have any problems with the new forums text editor, we appreciate your feedback!
D
Dsign 29
April 14 2019, 18:38 #385953
done!... still not working...
On Avanced of CALENDAR-2
Earliest date/time
{date:(data:CALENDAR-1_NAME)$+30days}
On Start calendar
#CALENDAR-1_ID (tried with CALENDAR-1_NAME too)
is the any other thing that ive should have done/add somewhere (event/function/etc)?
admin 27
April 14 2019, 19:29 #385954
Do you have the first calendar reloading the 2nd one on change ?
Max
If your main question got answered then please mark the answer using the button!
Please let us know if you have any problems with the new forums text editor, we appreciate your feedback!
D
Dsign 29
April 14 2019, 19:30 #385955
The content here is visible only for authorized users.
Attachments
P01.jpg
P01.jpg
(596.59 KiB)
116 Downloads/Views
admin 27
April 14 2019, 19:36 #385958
Ok, that setting is fine, but the first field "reloads" the 2nd one on change ?
Max
If your main question got answered then please mark the answer using the button!
Please let us know if you have any problems with the new forums text editor, we appreciate your feedback!
D
Dsign 29
April 14 2019, 19:50 #385959
The content here is visible only for authorized users.
Attachments
P02.jpg
P02.jpg
(536.44 KiB)
119 Downloads/Views
D
Dsign 29
April 14 2019, 19:51 #385960
Then,.. what should i put in the value field?
admin 27
April 15 2019, 19:37 #385998
The value setting of the 2nd calendar field will have
{date:(data:first_calendar_name)$+30days}
But this will work only if the first calendar field reloads the 2nd calendar.
Did you manage to get it working ?
Max
If your main question got answered then please mark the answer using the button!
Please let us know if you have any problems with the new forums text editor, we appreciate your feedback!
D
Dsign 29
April 15 2019, 23:34 #386005
no yet, because i still can't make the fist calendar reload the second one.
the pics i sent you show the first calendar reload action setting.
... what is still missing there?
P
phoenix89r 5
April 16 2019, 06:33 #386009
Hi,
I set the FIRST calendar events tab in this way:
on "change"
actions=reload
Element(s) identifier=second_calendar_name.
In the SECOND calendar advanced tab I set:
Earliest date/time= {date:(data:first_calendar_name)$+30days}
start calendar=#calendar-1_ID
but when i try to select date in the first calendar it reloads all the forms, not only the SECOND calendar!
what did i do wrong?
thanks