webform_clear.module in Webform Clear 7
Same filename and directory in other branches
File
webform_clear.moduleView source
<?php
/**
* Implements hook_form_alter().
*/
function webform_clear_form_alter(&$form, &$form_state, $form_id) {
// Webform is being presented to visitor.
if (isset($form['#node']->webform) && in_array('webform_client_form_submit', $form['#submit'])) {
$form['#submit'][] = 'webform_clear_client_submit';
}
}
/**
* Submit callback for the client form.
* Fetch node field value and insert it in Webform field.
*
* @param $form
* @param $form_state
*/
function webform_clear_client_submit($form, &$form_state) {
$nid = $form_state['values']['details']['nid'];
module_load_include('inc', 'webform', 'includes/webform.report');
webform_results_clear($nid);
return;
}
Functions
Name![]() |
Description |
---|---|
webform_clear_client_submit | Submit callback for the client form. Fetch node field value and insert it in Webform field. |
webform_clear_form_alter | Implements hook_form_alter(). |