I have a JQuery DatePicker which I always want to be displayed, so I've assigned it to a div. I want it to behave as shown in this example, where the selected date appears in the input box, but for some reason it just won't work this way for me. Is there anything I can do to have the value shown in the input box? I want the user to be able to either manually type the date into the box, or for them to select the date from the datepicker. This is the relevant part of my code as it stands so far.
<form class="form-horizontal" role="form" action="<?=$_SERVER['PHP_SELF']?>" method="post">
<div class="form-group row">
<input type="text" id="my-input">
<div id="my-datepicker"></div>
</div>
<div class="form-group last">
<input type="submit" name="submit_date" value="Show"/>
</div>
</form>
<script>
$("#my-datepicker").datepicker().on('changeDate', function (e) {
$("#my-input").val(e.format());
});
</script>
This link shows my page so far: https://gyazo.com/9ad02c1c1e2dbb832894f38107dc8bb9