janick.eisert
Posts: 0
Joined: Tue Apr 24, 2012 1:32 pm

date picker: set value

How can I set a date in the date picker? I've tried this, but I can only set the value attribute which is not used (always empty after choosing a date):

$(".datePicker").find('input').attr('value', '2012-05-14');

Thanks for your help!

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

date picker: set value

What do you mean it's always empty after choosing a date..?

janick.eisert
Posts: 0
Joined: Tue Apr 24, 2012 1:32 pm

date picker: set value

After selecting a date in the date picker, the value attribute of the input tag has no value/is empty.

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

date picker: set value

You set the date via calendar popup, date is set into the input field and then you want to read the value with JavaScript?

janick.eisert
Posts: 0
Joined: Tue Apr 24, 2012 1:32 pm

date picker: set value

Yes. I want to know how to read and set the value with JavaScript.

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

date picker: set value

Something is wrong with the selector, this works:

code
$('input').attr('value', '2012-05-14');
/code

Return to “Issues”