I have a button and hidden input.
I want the datepicker to open under the button that I click. And the selected date is inserted into the hidden input.
I don't want to create a new button (using datepicker options), and I don't want to show the input.
<button type="button" class="btn" id="date_button">Select Date...</button> <input type="hidden" name="date" id="date_field" /> <script> $('#date_button').datepicker({ showOn: "button", onSelect: function( dateText ) { $('#date_field').val( dateText ); $('#date_button').text( dateText ); } }) </script>
Any ideas?
jquery-ui jquery-ui-datepicker datepicker
VMOrtega
source share