hi,
I have carefully read the faqs for chronoforms v5.
I'm implementing a form for requesting a service with start date and end date.
I want to impose that the end date of the service is not before the start date.
Could you post an example code of the "date_change" function described in the faqs?
Https://www.chronoengine.com/faqs/70-cfv5/5216-date-control-using-cfv5-date-picker-element.html
Thanks.
I have carefully read the faqs for chronoforms v5.
I'm implementing a form for requesting a service with start date and end date.
I want to impose that the end date of the service is not before the start date.
Could you post an example code of the "date_change" function described in the faqs?
Https://www.chronoengine.com/faqs/70-cfv5/5216-date-control-using-cfv5-date-picker-element.html
On selection made
To trigger a function when a date selection has been made, you can use this:
data-on_date_selected=date_change
That code would call a JS function named "date_change" after the date selection has been made, you can use this to set the start date of another field.
Thanks.
Hi jetroh,
This feature is available in the calendar element settings in v6 so please use v6 instead.
Best regards,
Max
This feature is available in the calendar element settings in v6 so please use v6 instead.
Best regards,
Max
Ok but...
I used this feature with CF5 and JS code was stored in "setup" tab then in "onload" wrap.
Now we find a JS code in "Designer/Custom" area; Do I just have to transfer the code from CF5 setup to CF6 Design/custom ? (that's what I did but without success after having of course modified the calendar_id)
For more information, here is the code in setup :
var chronoJQ = jQuery;
function date_change(elem){
var start_date = new Date();
var format = elem.data("gdatetimepicker-format") ? elem.data("gdatetimepicker-format") : GDatetimepicker.format;
var parsed_start_date = start_date.parse_date(elem.val(), format);
start_date.setUTCFullYear(parsed_start_date.Y, parsed_start_date.m - 1, parsed_start_date.d);
var new_start_date = new Date(start_date.getTime() + (3 * 24 * 60 * 60 * 1000));
chronoJQ("#calendar12").val(new_start_date.format_date(format));
chronoJQ("#calendar12").data("start_date", new_start_date.format_date(format));
}
And in the body part of my 2 calendars (1 has data-on_date_selected=date_change and the 2nd has data-start_date=date() in extra attributes for both of them) : works in CF5
What's wrong ? (moved datepicker to calendar as calendar_id (#datepicker12 in CF5)
Regards
I used this feature with CF5 and JS code was stored in "setup" tab then in "onload" wrap.
Now we find a JS code in "Designer/Custom" area; Do I just have to transfer the code from CF5 setup to CF6 Design/custom ? (that's what I did but without success after having of course modified the calendar_id)
For more information, here is the code in setup :
var chronoJQ = jQuery;
function date_change(elem){
var start_date = new Date();
var format = elem.data("gdatetimepicker-format") ? elem.data("gdatetimepicker-format") : GDatetimepicker.format;
var parsed_start_date = start_date.parse_date(elem.val(), format);
start_date.setUTCFullYear(parsed_start_date.Y, parsed_start_date.m - 1, parsed_start_date.d);
var new_start_date = new Date(start_date.getTime() + (3 * 24 * 60 * 60 * 1000));
chronoJQ("#calendar12").val(new_start_date.format_date(format));
chronoJQ("#calendar12").data("start_date", new_start_date.format_date(format));
}
And in the body part of my 2 calendars (1 has data-on_date_selected=date_change and the 2nd has data-start_date=date() in extra attributes for both of them) : works in CF5
What's wrong ? (moved datepicker to calendar as calendar_id (#datepicker12 in CF5)
Regards
Hi fguyon,
In v6 there is a "Calendar" field, under the "Advanced" section you can specify the start and end calendar elements, no need for any extra code.
Best regards,
Max
In v6 there is a "Calendar" field, under the "Advanced" section you can specify the start and end calendar elements, no need for any extra code.
Best regards,
Max
Sure I miss Something !!
Let's imagine 2 calendars 1 & 2
So, in calendar 2, what do I enter in "Advanced" section, in "start calendar" field (I suppose) to get as default date the date entered in calendar 1 ??
I'm sorry for disturbing as I don't understand, but I really don't see and I think that it's important for (me) many people : I hope solution will be useful to all of us !!
PS : then, once this first step validated, what to enter in calendar 2 starting date field to get the calendar 1 entered dated + x days ? Without any code...
Many thanx®ards
Let's imagine 2 calendars 1 & 2
So, in calendar 2, what do I enter in "Advanced" section, in "start calendar" field (I suppose) to get as default date the date entered in calendar 1 ??
I'm sorry for disturbing as I don't understand, but I really don't see and I think that it's important for (me) many people : I hope solution will be useful to all of us !!
PS : then, once this first step validated, what to enter in calendar 2 starting date field to get the calendar 1 entered dated + x days ? Without any code...
Many thanx®ards
Hi jetroh,
This feature is available in the calendar element settings in v6 so please use v6 instead.
Best regards,
Max
Unfortunately in my web space is available php 5.45. Chronoforms V6 requires php 5.6.
Is there a way to activate the function I need in chronoforms v5?
thank you.
Hi jetroh,
Please try to install v6 and check if it works first, you may also ask your host admin to upgrade the server software.
The feature you need can be achieved with v5 but with much more work.
Best regards,
Max
Please try to install v6 and check if it works first, you may also ask your host admin to upgrade the server software.
The feature you need can be achieved with v5 but with much more work.
Best regards,
Max
Hi jetroh,
Please try to install v6 and check if it works first, you may also ask your host admin to upgrade the server software.
The feature you need can be achieved with v5 but with much more work.
Best regards,
Max
I asked for php upgrade;)
To update chronoforms from v5 to v6 just install the new version?
Or do you need import / export procedures?
thank you
Hi jetroh,
When you install v6 it will install as a new extension, and v5 will stay as its, you can import a v5 form into v6 but it will not be imported 100%, only the designer section and not all the features because of the differences between the 2 versions.
Best regards,
Max
When you install v6 it will install as a new extension, and v5 will stay as its, you can import a v5 form into v6 but it will not be imported 100%, only the designer section and not all the features because of the differences between the 2 versions.
Best regards,
Max
When import my forms backuped in v5 into v6 i receve this error:
"Invalid backup file extension."
"Invalid backup file extension."
Hi jetroh,
Please ensure that your backup file extension is either cf6bak or cf5bak
Best regards,
Max
Please ensure that your backup file extension is either cf6bak or cf5bak
Best regards,
Max
This topic is locked and no more replies can be posted.