0
votes

Am creating a button for an Umbraco back-end content editing page that will retrieve a load of data from another database and auto-populate a few of the fields. However some of the fields use the Umbraco datepicker. I can change the value of the text box but when I click to view the datepicker calendar, it has the wrong date selected. How can I set the date of the datpicker so it matches what's in the text box rather than just the change what's in the textbox?

Thanks

1

1 Answers

3
votes

Think I've got it. Once change value of textbox call .change() on the text box and this will update the datepicker.

Here is some abridged example:

<script type="text/javascript">
$("#myDatePicker").val("2016-12-25 00:00:00");
$("#myDatePicker").change();
</script>

Hopefully be of help to someone else.