开发者

Jquery and DatePicker - change calendar by the date in the input field

i have the value polled from the db and if the user want to change it - i want the calendar to be s开发者_如何学编程et first to the date already in the field

im using asp and this picker http://www.kelvinluck.com/assets/jquery/datePicker/v2/demo/


If you are using my datepicker then all you should need to do is place the value from the database into the value of the field. How you do this will depend on what serverside language you use but an example in PHP:

<input type="text" id="my_date" value="<?php echo $date_from_db; ?>" class="datepicker" />

Presuming that $date_from_db is set in PHP to the date from the database as a string and is in the same format as you are using for the date picker.


Found the solution: $('.date-pick').dpSetSelected('day/month/year');

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜