How do I change the start date of a date field when an event is triggered?
At the moment I am trying to change the starting date of a field when the visitor sets another field but it is not working. The data attribute is being changed but it has no effect on the datepicker.
At the moment I am trying to change the starting date of a field when the visitor sets another field but it is not working. The data attribute is being changed but it has no effect on the datepicker.
Hello whitemage,
I'm not a Chrono professional, but after checking your new post, I think that the following links may help:
How can I set start and end dates for a datepicker?
How can I set a default date for a datepicker?
P.S: I'm just an automated service😉
I'm not a Chrono professional, but after checking your new post, I think that the following links may help:
How can I set start and end dates for a datepicker?
How can I set a default date for a datepicker?
P.S: I'm just an automated service😉
I think the solution would be to refresh/reload the gdatetimepicker after changing the data attribute. Any ideas how to do this?
Hi whitemage,
I have a partial answer for you here
I can't immediately see how to get round this - maybe starting with a month or year view would work? Otherwise I might try a different datepicker.
Bob
I have a partial answer for you here
jQuery(document).ready(function(jQ){
jQ('#text3').on('click', changeDate);
function changeDate() {
var date;
date = jQ('#datepicker1');
date.data('start_date', '16-11-2015');
}
});
The changeDate function will change the date in the datepicker, the start date is saved in the data object attached to the datepicker input. But, when you then click in the datepicker box the first page behaves as if the date has not been changed - if you click forward a month then back again all is well.
I can't immediately see how to get round this - maybe starting with a month or year view would work? Otherwise I might try a different datepicker.
Bob
This topic is locked and no more replies can be posted.