javascript - getting the date from datepicker -
i'm using jquery
's datepicker
in other dates user. defined form following:
<form id="myform" action="/graphs/get_builds" method="post"> start: <input type="text" id="start" /> end: <input type="text" id="end" /> <input type="submit" value="go" /> </form>
on js
side, have:
$(document).ready(function () { var data = { 'start': $('#start').datepicker({ onselect: function(datetext, instance) { return $(this).datepicker('getdate'); } }); }; console.log(data); // bind 'myform' , provide simple callback function $('#myform').ajaxform(function () { console.log("hello"); }); });
i know definition on data
value it's not right, how value of start
, end
in other pass ajaxform
. need value of both start
, end
. on server side have method waiting both start
, end
dates perform operations. how accomplish that?
use input value (set datepicker). server side need set 'name' property first.
$('#myform').ajaxform( function() { var start_data = $("#start").val(); var end_data = $("#end").val(); console.log(start_data); console.log(end_data); console.log("hello"); });
Comments
Post a Comment