Skip to main content
Commonmark migration
Source Link

When i try to add a new node of type article for example i want to add a new submit button with new submit function so i did like this in hook_form_alter :

function MYMODULE_form_alter(&$form, &$form_state, $form_id){
  switch ($form_id){
        case "article_node_form" :
            $form['submit_delegate'] = array(
                '#type' => 'submit', // I tried also '#type' => 'button'
                '#value' => t('Delegate'),
                '#submit' => array('MYMODULE_form_submit_article_delegate'),
            );
            dpm($form);
            break;
  }
}

this is the dpm result of the new form element :

submit_delegate (Array, 3 elements) #type (String, 6 characters ) button #value (String, 8 characters ) Delegate #submit (Array, 1 element)

type (String, 6 characters ) button

value (String, 8 characters ) Delegate

submit (Array, 1 element)

Thanks in advance.

When i try to add a new node of type article for example i want to add a new submit button with new submit function so i did like this in hook_form_alter :

function MYMODULE_form_alter(&$form, &$form_state, $form_id){
  switch ($form_id){
        case "article_node_form" :
            $form['submit_delegate'] = array(
                '#type' => 'submit', // I tried also '#type' => 'button'
                '#value' => t('Delegate'),
                '#submit' => array('MYMODULE_form_submit_article_delegate'),
            );
            dpm($form);
            break;
  }
}

this is the dpm result of the new form element :

submit_delegate (Array, 3 elements) #type (String, 6 characters ) button #value (String, 8 characters ) Delegate #submit (Array, 1 element)

Thanks in advance.

When i try to add a new node of type article for example i want to add a new submit button with new submit function so i did like this in hook_form_alter :

function MYMODULE_form_alter(&$form, &$form_state, $form_id){
  switch ($form_id){
        case "article_node_form" :
            $form['submit_delegate'] = array(
                '#type' => 'submit', // I tried also '#type' => 'button'
                '#value' => t('Delegate'),
                '#submit' => array('MYMODULE_form_submit_article_delegate'),
            );
            dpm($form);
            break;
  }
}

this is the dpm result of the new form element :

submit_delegate (Array, 3 elements)

type (String, 6 characters ) button

value (String, 8 characters ) Delegate

submit (Array, 1 element)

Thanks in advance.

Source Link

new submit button to node form not displayed?

When i try to add a new node of type article for example i want to add a new submit button with new submit function so i did like this in hook_form_alter :

function MYMODULE_form_alter(&$form, &$form_state, $form_id){
  switch ($form_id){
        case "article_node_form" :
            $form['submit_delegate'] = array(
                '#type' => 'submit', // I tried also '#type' => 'button'
                '#value' => t('Delegate'),
                '#submit' => array('MYMODULE_form_submit_article_delegate'),
            );
            dpm($form);
            break;
  }
}

this is the dpm result of the new form element :

submit_delegate (Array, 3 elements) #type (String, 6 characters ) button #value (String, 8 characters ) Delegate #submit (Array, 1 element)

Thanks in advance.