How to prepopulate drupal form and still execute a custom submit handler I want to build a custom edit form for a existing node. The edit form should not show all fields and should be populated with the existing field values. Furthermore I want to add a few custom submit buttons. I know I can pre populate the fields with #default_value, but there are quite a lot of fields I have to pre populate like that, so I wanted to pre populate them all at once.

I have made a form function with the following code:

$node = (array)node_load($nid);
$form_state = array();
$form_state['values'] = $node;
$form = node_form($form_state, $node);
drupal_prepare_form('node_form', $form, $form_state);


I have also defined a custom submit button:

   $form['submit_one'] = array(
       '#type' =&gt; 'submit',
       '#value' =&gt; t('Gereed'),
       '#weight' =&gt; 10,
       '#submit' =&gt; array('custom_form_submit_one'),  
   );


And a submit handler:

 function custom_form_submit_one($form_id, $form_values) {
   watchdog ("Hello","Hello");  
 }


When I press the submit button, the submit handler is not called.

When I disable the statement:

$node = (array)node_load($nid);


and I press the submit button, the submit handler is called. However, my form is not pre populated with the values.

Is it possible what I want to do? Can I use a custom form and pre populate the fields (without specifying #default_value for each field)?
Why must you have a separate form? I think a simpler approach would be to modify the existing form on a conditional basis via a form alter hook:

function hook_form_alter(&amp;$form, &amp;$form_state, $form_id) {
  // match our custom content type ('yourContentType_node_form') edit form, and ensure
  // we're editing a specific node
  if ($form_id == 'yourContentType_node_form' &amp;&amp; arg(1) == '123') {
    // add new submit buttons
    $form['actions']['submit_one'] = array(
      '#type' =&gt; 'submit',
      '#value' =&gt; t('Gereed'),
      '#weight' =&gt; 10,
      '#submit' =&gt; array('custom_form_submit_one'),
    );
  }
}