You are here

function _webform_action_set_component in Webform 7.4

Performs the conditional action set on an implemented component.

Setting the form element allows form validation functions to see the value that webform has set for the given component.

Parameters

array $component: The webform component array whose value is being set for the currently- edited submission.

array $element: The form element currently being set.

array $form_state: The form's state.

string $value: The value to be set, as defined in the conditional action.

Related topics

File

./webform.api.php, line 1077
Sample hooks demonstrating usage in Webform.

Code

function _webform_action_set_component(array $component, array &$element, array &$form_state, $value) {
  $element['#value'] = $value;
  form_set_value($element, $value, $form_state);
}