Home » » How To Pre-populate Datepicker Textbox With Today's Date Using JQuery?

How To Pre-populate Datepicker Textbox With Today's Date Using JQuery?

Rendyon | 4:36 AM | 0 comments
Suppose we have a textbox and we want to add a datepicker in it. We can do this easily with the help of JQuery.


Here is the working code:
HTML Code:
--------------------
<input type="text" size="10" value="" id="datepicker1"/>

JQuery Code:
--------------------

$(function() {
$("#datepicker1").datepicker({
dateFormat: "yy-mm-dd"
}).datepicker("setDate", "0");
})

Check live example here: http://jsfiddle.net/jeetu_verma11/X4Bcf/
Share this article :

0 comments:

 
Copyright © 2011. Find Updates - All Rights Reserved
Template Modify by Creating Website
Proudly powered by Blogger