views:

158

answers:

1

Hello, I would like to set a value to input tag on which I create a datepicker. When datepicker is initialized I want to set it. Here is an some pseudo example what I want:

HTML:

<input id="test" value=""></input>

Javascript:

$('#text').datepicker({ dateFormat: 'dd.mm.yy'});
var currentDate = $('#text').datepicker('getDate');
$('#text').val(currentDate.format('dd.mm.yy'));

Thanks in advance!