0

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 Answer 1

3

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.