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' => 'submit', '#value' => "Annuleren", '#access' => TRUE, '#weight' => 55, '#submit' => $link, '#limit_validation_errors' => 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' => "Annuleren",
How to solve this?