title: How do I insert an input's value into a separate form?
body: <p>I'm making a tool for my university that allows students to create a list of classes by doing the following:</p>
  
  <ol>
  <li><p>Searching by course title for their course via an autocomplete input field.</p></li>
  <li><p>Adding that course to a separate form that upon being submitted creates a course list.</p></li>
  </ol>
  
  <p>I am trying to link the autocomplete and the course list form with an 'add to course list' button that inserts a hidden input field into the course list form which can subsequently be submitted by a 'create course list' button.</p>
  
  <p>My question is this:
  How do I take the value of the autocomplete input and insert it into the course list form without using AJAX?</p>
  
  <p>So far I have something like the following:</p>
  
  <pre><code>&lt;%= text_field_with_auto_complete :course, :title, :size =&gt; 40 %&gt;
  &lt;%= link_to_function "Add to Course List" do |page|
      page.insert_html :top, :course_list, hidden_field(:courses, :course, 
      {:value =&gt; "$('course_title').value"}) %&gt;
  
  &lt;% form_for(@course_list) do |f|%&gt;
      &lt;div id="course_list"&gt;Insert selected courses here.&lt;/div&gt;
  &lt;% end %&gt;
  </code></pre>