srisar
srisar

Reputation: 1571

How to use button to get a Jquery Datepicker?

I want to create a Datechooser, but I want a button near the text field and when I click the button, the Datepicker should show up, but selected date should be in the text box.

How can I do this.

Upvotes: 0

Views: 137

Answers (1)

codeandcloud
codeandcloud

Reputation: 55308

Try jQuery UI DatePicker.

$(function() {
    $("#datepicker").datepicker({
        showOn: "button",
        buttonImage: "images/calendar.gif",
        buttonImageOnly: true
    });
});

Demo from jQuery UI site: http://jqueryui.com/demos/datepicker/#icon-trigger

Upvotes: 2

Related Questions