title: Drupal form_submit and default_value
body: <p>I have a simple form:</p>
  
  <pre><code>function mymodule_test_form(&amp;$form_state, $nid) {
    form['submit'] = array(
      '#type' =&gt; 'submit',
      '#value' =&gt; 'Click me!',
    );
    $form['mymodule_status'] = array(
      '#type' =&gt; 'select',
      '#attributes' =&gt; array('class' =&gt; 'myclass'),
      '#default_value' =&gt; variable_get('mymodule_status', 0),
      '#options' =&gt; array('one', 'two', 'three', 'four', 'five'),
    );
    return $form;
  }
  
  function mymodule_test_form_submit($form, &amp;$form_state) {
    global $user;
    db_query("INSERT INTO {mymodule} (nid, uid, number, created) VALUES (%d, %d, %d, " . time() . ")", $nid, $user-&gt;uid, $status);
  }
  </code></pre>
  
  <p>And in my node-contenttype.tpl.php file I print drupal_get_form('mymodule_test_form', $node->nid). BTW, is it the right way to print the drupal_get_form in the template? I tried adding the drupal_get_form to the hook_nodeapi view state, but nothing outputs, so I just ended up printing it in the template.</p>
  
  <p>Another thing is the default value, I'm not sure how to use that. The variable_get always is 0. Do I need to create a custom query of my own and set that as my default value? I thought the default_value is automatically retrieved by drupal or something...</p>
  
  <p>Hope I can get some help. Thanks.</p>
  
  <p>Edit: Found out the node id is under: $form['#parameters'][2]</p>