BobbyJones
BobbyJones

Reputation: 1364

jQuery Datepicker today button does not put today's date in the input box

I need your help,

I just added the buttonpane to my Date Picker, however it seems that when I click on the 'Today' button, what should happen is that it should select the present date and also put its value into the input box.

What am I doing wrong?

            $("#date1").datepicker({
                showOn: 'button',
                buttonImage: 'images/cal.png',
                showButtonPanel: true,
                buttonImageOnly: true,
                changeMonth: true,
                changeYear: true,
                onSelect: function() {
                    if ($(this).hasClass('invalid') == true) { $(this).removeClass('invalid') }
                    $(this).change();
                }

            });//end of datepicker

The HTML is as follows:

<input type="text" id="date1">

Upvotes: 1

Views: 5381

Answers (1)

tcigrand
tcigrand

Reputation: 2397

It's not designed to do that, it's only designed to take the calendar view back to today if you navigate to another month.

See this comment about how to modify the functionality.

Upvotes: 4

Related Questions