jack
jack

Reputation: 1921

jquery datepicker steals click/focus event from inputfield

in the following code http://jsfiddle.net/KRFCH/24/

<pre>
<input type="text" id="d" />
 <div id="z"></div>

pseudo code:

 $('#z').datepicker({
  inline: true,
  altField: '#d'
});

$('#d').change(function(){
    $('#z').datepicker('setDate', $(this).val());
});
$('#d').click();
$('#d').focus();

I can't get the input box to get the focus? any ideas how I can make this happen?

Upvotes: 0

Views: 263

Answers (1)

geevee
geevee

Reputation: 5451

just implement onSelect event handler:

$("#z").datepicker({
    inline: true,
    altField: '#d',
    onSelect: function () {
        this.focus();
    }
});

Upvotes: 1

Related Questions