TheShadow123
TheShadow123

Reputation: 185

How to press a button, after jQuery calendar closes on click

<script type="text/javascript">    
$(function() {
    $('.date-picker').datepicker( {
        changeMonth: true,
        changeYear: true,
        dateFormat: 'yy-mm-dd'
    });
});
</script>

Is it possible to press a button(Space) when the datepicker closes, after someone selects a date?

Upvotes: 1

Views: 41

Answers (2)

Deenadhayalan Manoharan
Deenadhayalan Manoharan

Reputation: 5444

Try this...

<script type="text/javascript">    
$(function() {
    $('.date-picker').datepicker( {
        changeMonth: true,
        changeYear: true,
        dateFormat: 'yy-mm-dd',
        autoclose: true     //Add auto close as true
    });
});
</script>

Upvotes: 1

Sudharsan S
Sudharsan S

Reputation: 15393

Yes there is one option in datepicker 'hide'

$("button").click(function() {
  $('.date-picker').datepicker("hide");
});

Upvotes: 0

Related Questions