title: Get datepicker and pass to url
body: <p>It is a datepicker. I need to pass selected date as parameters in php form url. 
  The datepicker value is in jQuery. I got the selected date value through ajax and i posted as $_POST['from'] and $_POST['to'].</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  $(document).ready(function(){
  var frm = $('#easy_widget_form');
      var first, second;
      first = $(".hasDatepicker[name=from]").val();
      second = $(".hasDatepicker[name=to]").val();
      //alert(first + " , " + second);
  
      first = $(".hasDatepicker[name=from]").datepicker('getDate');
      second = $(".hasDatepicker[name=to]").datepicker('getDate');
      //alert(first + " , " + second);
  
      jQuery.ajax({
              type: "POST",
              url: "form_widget.php",    
              data: "first=" +first+"&amp;second="+second,
              dataType: "text",
              success: function(){
                  alert("Done");
              }
          });
  }};
  &lt;/script&gt;
  </code></pre>
  
  <p>When i pass the date in url <a href="http://www.domain.com/?from=" rel="nofollow">http://www.domain.com/?from=</a>".$_POST['from']."&amp;to=".$_POST['to']; it doesn't work.</p>
  
  <p><strong>Error :</strong> String was not recognized as a valid DateTime.</p>
  
  <p>Here is my PHP</p>
  
  <pre><code>&lt;form method="post" action="http://www.domain.com/?from=".$_POST['from']."&amp;to=".$_POST['to']" name="easy_widget_form" id="easy_widget_form"&gt;
  &lt;input id="easy-widget-datepicker-from" type="text" name="from" value="20.04.2014" class="hasDatepicker"&gt;
  &lt;input id="easy-widget-datepicker-to" type="text" name="to" value="22.04.2014" class="hasDatepicker"&gt;           
  
  &lt;p class="easy-submit"&gt;&lt;input type="submit" class="easybutton" value="Reserve now!"&gt;&lt;/p&gt;                    
  &lt;/form&gt;
  </code></pre>
  
  <p>can someone help?</p>