Why we should use 'drupal_form_submit' function and not just the $form['submit'] ?

http://api.drupal.org/api/drupal/includes%21form.inc/function/drupal_for...

<?php
$form_id
= 'formexample_nameform';
$form_state['values'] = array(
'user_name' => t('Marvin'),
'favorite_color' => t('green')
);
// Submit the form using these values.
drupal_form_submit($form_id, $form_state);
?>

Comments

Hi Mike, It depends on the

Hi Mike,

It depends on the use case. $form['submit'] can be used to override the first and or default submit handler while $form['submit'][] can be used to add an additional submit handler. The function drupal_form_submit retrieves, populates, and processes a form, which is very different to altering $form['submit'].

Cheers,

nobody click here