title: Submitting form with jQuery and PHP
body: <p>I'm trying to submit a form when a button on another form is pressed. The form will simply be updated, and I'm trying to capture any information that has already been typed in.</p>
  
  <p>This is just how the information flows. The forms actually aren't identical, this is just for simplification of the concept.</p>
  
  <pre><code>&lt;?
  
  function form(){
      ?&gt;
      &lt;form method="post" id="form1"&gt;
      &lt;input type="text" name="textinput"/&gt;
      &lt;input type="submit" name="submit_form1"/&gt;
      &lt;/form&gt;
  
      &lt;?
      $form2 = new forms();  //assume form 2 is setup similarly to form1 and its &lt;form&gt; tags are in that form like they are for form 1
      $forms-&gt;get_form2();
      ?&gt;
  }
  
  &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
  
  $('#form2').click(function() {
    $('#form1').submit();
  });
  
  &lt;/script&gt;
  &lt;?
  </code></pre>
  
  <p>I tried doing something like this but it's not working. Assuming form 1 has something entered (but not submitted), I'd like to capture these values when a button on form 2 is pressed.</p>
  
  <p>I also tried this (which I feel would work adequately) but I had no success either.</p>
  
  <pre><code>$('#form1').submit(function() {
    alert('Handler for .submit() called.');
    return false;
  });
  </code></pre>