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.

This is just how the information flows. The forms actually aren't identical, this is just for simplification of the concept.

```
<?

function form(){
    ?>
    <form method="post" id="form1">
    <input type="text" name="textinput"/>
    <input type="submit" name="submit_form1"/>
    </form>

    <?
    $form2 = new forms();  //assume form 2 is setup similarly to form1 and its <form> tags are in that form like they are for form 1
    $forms->get_form2();
    ?>
}

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript">

$('#form2').click(function() {
  $('#form1').submit();
});

</script>
<?

```

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.

I also tried this (which I feel would work adequately) but I had no success either.

```
$('#form1').submit(function() {
  alert('Handler for .submit() called.');
  return false;
});

```