Blog Archive

Wednesday, 10 September 2014

Drupal 7 - Add a cancel button on node forms (How to add a cancel button on node form?)

The following code from the "example.module" will help you  to add the cancel button to any node form.

2 comments:

  1. Really helpful. Thank you. I an getting

    Notice: Undefined index: destination in example_form_cancel().

    Do you know why??

    ReplyDelete
  2. You can use isset() to avoid the notice, like this:

    $url = isset($_GET['destination']) ? $_GET['destination'] : 'choose/your/path';

    ReplyDelete