title: Passing javascript date to rails form
body: <p>At the top of a page I have a javascript datepicker. The selected date is stored in the variable <code>newDate</code></p>
  
  <p>Lower I have a form in rails like so:</p>
  
  <pre><code>&lt;%= form_for(@checkin) do |f| %&gt;
    ...
  &lt;% end %&gt;
  </code></pre>
  
  <p>I want the date selected above to get passed as a parameter upon form submission. I want to do something like this:</p>
  
  <pre><code>&lt;%= f.hidden_field :checkedin_at, :value =&gt; newDate %&gt;
  </code></pre>
  
  <p>But I'm pretty sure I can't mix client-side and server-side code like this. Is there another way to pull this off?</p>