Custom Input Masks: Allow optional characters

Created on 6 March 2018, over 7 years ago
Updated 16 August 2025, 3 days ago

Custom input masks do not allow for optional characters. This is a missing feature IMHO.

Here's one use case: Currently, Number fields do not support a required number of characters after the decimal place as per #2906039: Decimal number field? β†’ . As a result, I must make my own currency fields with a Text Field element and an input mask. There is a pre-configured "Currency" input mask that works in limited fashion. Unfortunately, if I want to remove the dollar sign from the field or use a different currency prefix, I CANNOT do it with a custom currency input mask because I only have REQUIRED characters to work with (9 = numeric; a = alphabetical; * = alphanumeric). This is a problem because the integer before the decimal can be any number of characters. For example, a mask such as 999.99 would force the user to enter 001.23, for a value of 1.23.

I propose there be OPTIONAL input mask characters. For example if 0's are optional and 9's are required, one could create a mask 009.99 to accept all digits from 0.01 to 999.99.

✨ Feature request
Status

Closed: works as designed

Version

5.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States nodecode

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024