jquery datepicker predefined date

Posted by r3try on Stack Overflow See other posts from Stack Overflow or by r3try
Published on 2012-09-13T08:11:43Z Indexed on 2012/09/13 9:38 UTC
Read the original article Hit count: 312

This might seem like a stupid easy question to some of you, but i'm new to jquery and can't get my datepicker to work like it should.

This is my textbox where the datepicker is attached to:

<asp:TextBox runat="server" ID="StartMonth" AutoPostBack="true" class="month-picker" />

and here is how i attach the datepicker. (I have multiple TextBoxes where the datepicker should be attached to, so i used the class attribute instead of the id.)

$(".month-picker").datepicker({ dateFormat: 'MM yy', changeYear: true, yearRange: '-9:+9' });

What i want to archive is when i click into the textbox where the text is "August 2012" it should set the pre-selected date of the datepicker to this date.

Can anyone help? Kind regards.

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery