You are here

function masked_input_attach_to in Masked Input 7.2

Attach the masked input to existing form elements.

This will ensure we properly merge process callbacks and not break essential functionality from the original form element.

File

./masked_input.module, line 232
Provides a form element, Field widget, and simple API for using the Masked Input jQuery plugin.

Code

function masked_input_attach_to(&$element) {
  $current = element_info($element['#type']) + array(
    '#process' => array(),
  );
  $info = element_info('masked_input') + array(
    '#process' => array(),
  );
  $element['#process'] = array_unique(array_merge($current['#process'], $info['#process']));
}