Thank you for this module which seems a perfect solution to format the output of a phone number field for example. Would it be feasable to make it compatible with phone number module ?
http://drupal.org/project/cck_phone
So that we can define a mask for each country (i.e. +33 (9)9 99 99 99 99 in France and +1 (999) 999 9999 in U.S.)

Here's the related issue in the Phone number queue:
http://drupal.org/node/1133536

Comments

helior’s picture

Title: Some content in the advanced help is necessary to test the module » Compatibility with cc_phone module
Status: Active » Postponed (maintainer needs more info)

Hmmm, I'm not familiar with cck_phone's code architecture. Would you be able to point out what parts aren't compatible? If a module wanted to use the masked input field widget in their field types, they could implement hook_field_widget_info_alter(), or they could use the form element directly in their form builders, like this:

$form['phone'] = array(
  '#type' => 'maskedinput',
  '#title' => t('Phone'),
  '#mask' => '(999) 999-9999',
);

Please note that for the field widget, only the numeric values will be stored in the db if the schema type is of the numeric variety. Otherwise, the entire thing is put in as varchar.

klonos’s picture

Title: Compatibility with cc_phone module » Masked-input: Compatibility with cck_phone module

Less vague title, minor typo in issue's title, and ...subscribing.