Set a value to DateTime Picker

Guidonzolo 20 Mar, 2013
Hello,
can anyone help me to set a value to a DateTime Picker field with javascript?
I've tried:
var MyDate = new Date('2012-03-12');
document.getElementById('Data_Control').value = MyDate;


but it does not work.

Thanks
Guido
GreyHead 21 Mar, 2013
Hi Guido,

What exactly do you need to do?

In your code MyDate is a JavaScript date object not a string. using toString() might work.

You can certainly set a date using JavaScript to update the DatePicker directly but not with the standard ChronoForms code as it doesn't name the datepicker object (or rather I've never found out how to access it).

Bob
Guidonzolo 30 Mar, 2013
Thanks GreyHead,
I've resolved setting to "Mootools Datepicker" in the form configuration.
Thanks again.

Guido Sabatini
This topic is locked and no more replies can be posted.