O'Reilly logo

Drupal 7 Webform Cookbook by Douglas Vernon Denny

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Updating a submission

In the instance where the user clicks on the Decline speaker application confirmation button our action needs to perform two tasks. Firstly, we must update the Status component to indicate that the submission has been declined. Secondly, we must send a notification e-mail to the speaker.

These actions will be driven by the confirmation form submit function.

As we will notice in the following code, the Drupal Form API will automatically look for a function named after the form generating function, where the function name ends with _submit.

In our implementation of hook_menu() we told Drupal that our form would be defined in a function called webform_custom_action_speaker_declined. This is the function we just coded.

When a visitor ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required