Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: Views Bootstrap 5.5.4 — Minor update available for module views_bootstrap (5.5.4). Release: Rightup theme 1.0.3 — Minor update available for theme vartheme_bs5_rightup (1.0.3). Release: CommentOn 1.0.6 — Minor update available for module commenton (1.0.6). Release: ChatGPT Ads 1.0.3 — Minor update available for module chatgpt_ads (1.0.3). Release: Opensolr Search 5.1.3 — Minor update available for module opensolr_search (5.1.3). Release: ServiceM8 Webform Integration 1.2.1 — Minor update available for module servicem8_webform (1.2.1). Release: PostfixAdmin 1.0.0 — Initial release available for module postfix_admin (1.0.0)! Release: ip_analyser 1.0.3 — Minor update available for module ip_analyser (1.0.3). Module Revived: Swagger-PHP OpenAPI 3 documentation generator 1.0.0 — Module swagger_php updated after 10 months of inactivity (1.0.0). Security Coverage: Microsoft Azure AI — Module ai_provider_azure now has official Drupal security advisory coverage.

Sometimes you need the user to input data in a particular format like a Social Security Number or a standard US phone number. By masking input of a particular textbox, you can change its behavior so that it accepts input only according to specified format, e.g. a masked phone number input box will only allow 10 digits of of the phone number to pass through and won’t accept any other input.

This module provides the Masked Input Plugin by Josh Bush.

Drupal 8 users:

Currently this module only works with Field type
1) Text(Plain)
2) Text(Formatted)
3) Text(Formatted,long)

Drupal 7 users:

This module includes:

  • A fully configurable field widget
  • A form element
  • A small API for embedding this feature on existing form elements
  • A user interface for configuring your own mask definitions
  • Drush integration
  • Drush make example file

You are free to use this module in the same fashion that is described for the Drupal 6 version, all you'll need to do is include the script from code using Libraries API

libraries_get_path('maskedinput') . '/jquery.maskedinput-1.3.js';

Drupal 6 users:

There is a simple configuration page that allows you to enter each field you want masked along with simple masking parameters.

Use the following format: $("#YOUR-FIELD-ID").mask("YOUR-MASK");

Where "YOUR-FIELD-ID" is the CSS ID of the textfield you want to mask and "YOUR-MASK" is one of the following

  • a - Represents an alpha character (A-Z,a-z)
  • 9 - Represents a numeric character (0-9)
  • * - Represents an alphanumeric character (A-Z,a-z,0-9)

Examples:

$("#phone").mask("(999) 999-9999");

$("#tax-id").mask("99-9999999");

$("#ssn").mask("999-99-9999");

$("#prod-num").mask("a*-999-a999");

$("#pct").mask("99%");

Optionally, if you are not satisfied with the underscore ("_") character as a placeholder, you may pass an optional argument to the maskedinput method.

$("#YOUR-FIELD-ID").mask("99-999999",{placeholder:"+"});

Version 2.0 authored and maintained by Helior Colorado
Version 1.0 authored and maintained by Tim Wooten

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
1
Tracked since
Apr 2024
Latest release
2 years ago
Releases (12 mo)
0
Maintenance
Dormant

Releases

Version Type Core Release date
2.0.0-beta2 Pre-release Apr 9, 2024