You are here

function hook_webform_component_render_alter in Webform 7.4

Allow modules to modify a webform component that will be rendered in a form.

Parameters

array $element: The display element as returned by _webform_render_component().

array $component: A Webform component array.

See also

_webform_render_component()

Related topics

1 invocation of hook_webform_component_render_alter()
_webform_client_form_add_component in ./webform.module
Add a component to a renderable array. Called recursively for fieldsets.

File

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

Code

function hook_webform_component_render_alter(array &$element, array &$component) {
  if ($component['cid'] == 10) {
    $element['#title'] = 'My custom title';
    $element['#default_value'] = 42;
  }
}