title: Why isn't my drupal form submit function being called?
body: <p>Ugh, this is probably something simple, but it is driving me crazy.  I've got a simple form (just a submit button) that I am inserting into a node using hook_nodeapi().  It gets inserted correctly, and the page refreshes when I submit, but it is never hitting the form_submit() function.  Here's the code:</p>
  
  <pre><code>function fantasy_stocks_nodeapi(&amp;$node, $op, $a3 = NULL, $a4 = NULL) {
    $form = drupal_get_form('fantasy_stocks_buy_me_form', $node);
    switch ($op) {
      case 'view':
        $node-&gt;content['body']['#value'] .= $form;
        break;
    }
  }
  
  function fantasy_stocks_buy_me_form(&amp;$form_state, $node) {
    $form['submit'] = array(
      '#type' =&gt; 'submit',
      '#title' =&gt; t('Buy') . ' ' . $node-&gt;title,
      '#description' =&gt; t('Add') . ' ' . $node-&gt;title . ' ' . t('to your stock portfolio.'),
      '#value' =&gt; t('Buy') . ' ' . $node-&gt;title,
      '#submit' =&gt; TRUE
    );
    $form['node_added'] = array(
      '#type' =&gt; 'hidden',
      '#value' =&gt; $node-&gt;nid
    );
    $form['#submit'][] = 'fantasy_stocks_buy_me_form_submit';
    return $form;
  }
  
  
  function fantasy_stocks_buy_me_form_submit( $form, &amp;$form_state ) {
    $message = 'You have submitted the ' . $form_id . ' form which contains the following data:&lt;pre&gt;' . print_r($form_values,true) . '&lt;/pre&gt;';
    drupal_set_message(t($message));
  }
  </code></pre>
  
  <p>I've tried adding an echo and die() in the submit function, it is definitely not getting called.  I've also tried leaving off the $form['#submit'] declaration, as the default should take care of it, but to no avail.  I know I must be missing something stupid.  Any ideas?</p>
  
  <p>Also, one thing that seemed weird is that the form gets rendered with the following tag:</p>
  
  <pre><code>&lt;form action="/MLMBid/node/5"  accept-charset="UTF-8" method="post" id="fantasy-stocks-buy-me-form-1"&gt; 
  </code></pre>
  
  <p>Is that normal, to have the "-1" appended to the form id?</p>