How to redirect a cancel button to destination on each form? I'm using the following code to add a cancel button on every form I have for add / edit of every content type. The target should be the destination adress in the url

In some content types it is working and some not:

$link = l(t('Annuleren'), drupal_get_destination());

      // add the actual button to the form
      $form['actions']['cancel'] = array(
        '#type'   =&gt; 'submit',
        '#value' =&gt; "Annuleren",
        '#access' =&gt; TRUE,
        '#weight' =&gt; 55,
        '#submit' =&gt; $link,
        '#limit_validation_errors' =&gt; array(),
        );

      dpm ($form);    


It has something todo with #value. If I replace it to #markup like below example then it is working but I do not get a label in the button. 

  '#markup' =&gt; "Annuleren",


How to solve this?
In your code above, you're using wrong value for #submit. #submit accepts an array of submit callback function names, check e.g. here.

You can either add a link in form, which will take user to destination and style the link to look like a button. Check example below:

function _custom_form() {
  $form['actions']['cancel'] = array(
    '#type'   =&gt; 'markup',
    '#markup' =&gt; '&lt;div class="form-cancel-button-wrapper"&gt;' . l(t("Cancel"), 'URL', array('attributes' =&gt; array('class' =&gt; array('form-cancel-button')))) . '&lt;/div&gt;',
  );

  return $form;
}


OR you can create a normal submit button and add a custom submit handler which will take user to destination. Check example below:

function _custom_form() {
  $form['actions']['cancel'] = array(
    '#type'   =&gt; 'submit',
    '#value' =&gt; "Cancel",
    '#weight' =&gt; 55,
    '#submit' =&gt; array('_custom_form_cancel')
    '#limit_validation_errors' =&gt; array(),
  );

  return $form;
}

function _custom_form_cancel($form, &amp;$form_state) {
  drupal_goto('URL');
}


Note: When you define a custom form element, you don't need to give #access property specifically, it is TRUE by default.