You are here

function elements_process_pattern in Elements 7

#process callback for #pattern form element property.

Parameters

$element: An associative array containing the properties and children of the generic input element.

Return value

The processed element.

See also

elements_validate_pattern()

2 string references to 'elements_process_pattern'
elements_element_info in ./elements.module
Implements hook_element_info().
elements_element_info_alter in ./elements.module
Implements hook_element_info_alter().

File

./elements.module, line 205

Code

function elements_process_pattern($element) {
  if (isset($element['#pattern']) && !isset($element['#attributes']['pattern'])) {
    $element['#attributes']['pattern'] = $element['#pattern'];
    $element['#element_validate'][] = 'elements_validate_pattern';
  }
  return $element;
}