Lemex
Lemex

Reputation: 3794

jQuery DatePicker - Focus Issue

<input type="text" id="personDOB" data-autofill="Under 18,N/A" />

$("#personDOB").datetimepicker({
    showOtherMonths : true,
    selectOtherMonths : true,
    changeMonth : true,
    changeYear : true,
    showButtonPanel : true
});

My current work around is : buttonImageOnly: true,

Using an icon rather than on focus...

The above is the text field and the date picker code.

Also using time addon: https://raw.github.com/trentrichardson/jQuery-Timepicker-Addon/master/jquery-ui-timepicker-addon.js

I notice the date picker shows on foucs, but only want it to show on click..

I've tried having a look through source code but cant seem to come out with a hack.

Any ideas?

Upvotes: 0

Views: 2586

Answers (1)

George D
George D

Reputation: 2365

Can you try to attach datetimepicker on click event and then show it:

$(function() {
    $("#personDOB").click(function() {
        $(this).datetimepicker({
        // .....
        }).datetimepicker("show");
    });
});

This would work for datepicker, but I am not sure it works for this datetimepicker.

Upvotes: 2

Related Questions