I am trying to get the buttontext of datepicker (which defaults to an ellipsis), to set itself as the value of the input.
I have multiple datepickers on the page, and unlike my example below I have an icon instead of a text input. I would like the value itself to show on the tooltip that appears when you hover over the icon.
I have tried – buttonText: $(this).val() as an option but it doesn’t pick anything up
Example – http://jsbin.com/unolot/3/
So my question – How do I get the buttontext of the datepicker input to match the value dynamically?
You have to handle two cases:
onSelectevent to change the button’s title attributecreateevent, you’ll have to update the title attribute manually after the widget has initialized.Don’t forget to set the default date of the picker to the initial value of the field, otherwise the default selected date is “today”
Something like this: