Hello again:
I have searched alot but maybe its an easy answer for specialists?
1)I need the datepicker like i think thats in the FAQ and kind of also here:
1a.)datepicker1 is set minimum today ....
1b.)datepicker2 is set minimum datepicker +1day .....
2.)datepicker1 if user selects date some day in the future
datepicker2 should switch date automatically future +1day (How to do?how to call this in google)
2a)
2b)
}
3.)how to also validate immideatly(before submit):
datepicker1 <datepicker2 and datepicker1 minimum "todays date"
I have searched alot but maybe its an easy answer for specialists?
1)I need the datepicker like i think thats in the FAQ and kind of also here:
1a.)datepicker1 is set minimum today ....
data-start_date=<?php echo date("d-m-Y"); ?>
1b.)datepicker2 is set minimum datepicker +1day .....
data-start_date=<?php $d = new DateTime('tomorrow'); echo $d->format("d-m-Y"); ?>
2.)datepicker1 if user selects date some day in the future
datepicker2 should switch date automatically future +1day (How to do?how to call this in google)
2a)
$("#datepicker1").on("select_date.gdatetimepicker", function(){
//event code here change datepicker2 +1day from datepicker1??
});
2b)
var startDate = new Date($('#datepicker1').val());
var endDate = new Date($('#datepicker2').val());
if (startDate < endDate){
// Do something
everything ok
}
3.)how to also validate immideatly(before submit):
datepicker1 <datepicker2 and datepicker1 minimum "todays date"
Hi mdma,
1) I think you have answered
2) and 3) both need custom JavaScript. For 2) you'd need to reset the start-date for the second picker (and I guess remove any set date if it was earlier). For 3) you'd add a custom validation function.
Bob
1) I think you have answered
2) and 3) both need custom JavaScript. For 2) you'd need to reset the start-date for the second picker (and I guess remove any set date if it was earlier). For 3) you'd add a custom validation function.
Bob
On selection made
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.
ok that goes into extra params of datpicker1 ? i need a code like the following (taken from jqueryUIdatepicker i want to translate to gdatetimepicker
have you an idea to get this working?
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.
ok that goes into extra params of datpicker1 ? i need a code like the following (taken from jqueryUIdatepicker i want to translate to gdatetimepicker
$(document).ready(function () {
$("#dt1").datepicker({
minDate: 0,
onSelect: function (date) {
var dt2 = $('#dt2');
var startDate = $(this).datepicker('getDate');
var minDate = $(this).datepicker('getDate');
dt2.datepicker('setDate', minDate);
startDate.setDate(startDate.getDate() + 1);
//sets dt2 maxDate to the last day of 30 days window
dt2.datepicker('option', 'minDate', startDate);
dt2.datepicker('option', 'minDate', minDate);
$(this).datepicker('option', 'minDate', minDate);
}
});
$('#dt2').datepicker({
});
});
have you an idea to get this working?
Hi mdma,
Not without sitting down and working through it. If you have code for the jQueryUI date-picker you could use that instead of the CF one?
Bob
Not without sitting down and working through it. If you have code for the jQueryUI date-picker you could use that instead of the CF one?
Bob
Hello Bob,
I will follow your advice and will go with jqueryui datepicker, because its more expandable, documented,
why isnt chronoforms standradized with jqueryUI datepicker already?
will there incopatibility issiues arise with some actions/email template perhaps?
I will follow your advice and will go with jqueryui datepicker, because its more expandable, documented,
why isnt chronoforms standradized with jqueryUI datepicker already?
will there incopatibility issiues arise with some actions/email template perhaps?
Hi mdma,
I don't know why Max chose to write his own datepicker, you'd need to ask him.
There shouldn't be any incompatibility - all that is submitted is a date string.
Bob
I don't know why Max chose to write his own datepicker, you'd need to ask him.
There shouldn't be any incompatibility - all that is submitted is a date string.
Bob
This topic is locked and no more replies can be posted.