Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get datepicker value using jQueryUI

Using the jQuery UI, how can I get the value of the date picker in the http post when it's used like this within a form:

<div id="datepicker"></div>
like image 580
ingh.am Avatar asked Jul 12 '11 15:07

ingh.am


2 Answers

$('#datepicker').datepicker({
    onSelect: function(dateText, inst) {
      $("input[name='something']").val(dateText);
    }
});

Here's a fiddle: http://jsfiddle.net/jensbits/9hbmy/338/

like image 197
jk. Avatar answered Nov 03 '22 00:11

jk.


Are you looking for this.

$("#datepicker").datepicker("getDate");
like image 37
naveen Avatar answered Nov 03 '22 00:11

naveen