| CARVIEW |
Select Language
HTTP/2 301
date: Sun, 28 Dec 2025 06:51:30 GMT
content-type: text/html; charset=UTF-8
location: https://docs.gravityforms.com/gform_input_masks/
server: cloudflare
strict-transport-security: max-age=604800
strict-transport-security: max-age=31536000; includeSubDomains
x-content-type-options: nosniff
x-content-type-options: nosniff
x-xss-protection: 1; mode=block
x-xss-protection: 1; mode=block
x-frame-options: SAMEORIGIN
x-frame-options: SAMEORIGIN
content-security-policy: frame-ancestors 'self';
referrer-policy: no-referrer
referrer-policy: strict-origin-when-cross-origin
x-redirect-by: WordPress
fastcgi-cache: MISS
cf-cache-status: DYNAMIC
nel: {"report_to":"cf-nel","success_fraction":0.0,"max_age":604800}
report-to: {"group":"cf-nel","max_age":604800,"endpoints":[{"url":"https://a.nel.cloudflare.com/report/v4?s=ycYyISDf01dSHLMRdFb%2B70JpgvyKIzjuIYYrFDgPIH%2BktEUR5OyheJ1%2FOoEDU8CRYw5%2FVCV1JnK4CFg3hl%2BVgbh86dua1SKtxLP6NA2kRDdBi7D8"}]}
cf-ray: 9b4f21282b748e4d-BLR
HTTP/2 200
date: Sun, 28 Dec 2025 06:51:31 GMT
content-type: text/html; charset=UTF-8
server: cloudflare
vary: Accept-Encoding
strict-transport-security: max-age=604800
strict-transport-security: max-age=31536000; includeSubDomains
x-content-type-options: nosniff
x-content-type-options: nosniff
x-xss-protection: 1; mode=block
x-xss-protection: 1; mode=block
x-frame-options: SAMEORIGIN
x-frame-options: SAMEORIGIN
content-security-policy: frame-ancestors 'self';
referrer-policy: no-referrer
referrer-policy: strict-origin-when-cross-origin
link: ; rel="https://api.w.org/"
link: ; rel="alternate"; title="JSON"; type="application/json"
link: ; rel=shortlink
fastcgi-cache: HIT
report-to: {"group":"cf-nel","max_age":604800,"endpoints":[{"url":"https://a.nel.cloudflare.com/report/v4?s=sKlV6uyfXkb0csf7%2ByLKJkmOM9RmMIKSPsP5Cr07y7E0fDkM1wliyNouEcKK9X7VsoZetGdKUPuWbEN%2B2UykpVh97rQUyfJwjMIBLR5jbaty1YI5"}]}
cf-cache-status: DYNAMIC
nel: {"report_to":"cf-nel","success_fraction":0.0,"max_age":604800}
content-encoding: gzip
cf-ray: 9b4f212ebeff8e4d-BLR
gform_input_masks - Gravity Forms Documentation
gform_input_masks
Description
Use this filter to edit the list of built-in input masks that are displayed in the Text Field input mask setting. Useful when adding a new custom input mask that will be used repeatedly.
Usage
add_filter( 'gform_input_masks', 'add_mask' );
Parameters
- $masks array
Current list of masks to be filtered, in the following format:
array(
'US Phone' => '(999) 999-9999',
'US Phone + Ext' => '(999) 999-9999? x99999',
'Date' => '99/99/9999',
'Tax ID' => '99-9999999',
'SSN' => '999-99-9999',
'Zip Code' => '99999',
'Full Zip Code' => '99999?-9999'
);
Examples
This example adds a new predefined mask for “Product Key”.
add_filter( 'gform_input_masks', function( $masks ) {
$masks['Product Key'] = 'a*-999-a999';
return $masks;
} );
Placement
This code can be used in the functions.php file of the active theme, a custom functions plugin, a custom add-on, or with a code snippets plugin.
See also the PHP section in this article: Where Do I Put This Code?
Source Code
This filter is located in GFFormsModel::get_input_masks() in forms_model.php.