getting actual date in DatePicker

Hello,

I’m using this kind of date fields :


$form->field($headermodel, 'duedate')->widget(\yii\jui\DatePicker::classname(), ['options' => ['class' => 'form-control']]);



I need to get and set the date via jquery but its not working

and I even can not get the value of the actual date :

console.log($( "input#invoiceheader-duedate" ).text());

Thanks !

To get/set the value of inputs with jquery you need to use .val() not .text(). You can set the value like .val(‘01/08/2017’).

Thanks - it works :)