The Single Line of text field on Modern Forms has a feature that allows you to define an Input Mask to help your users enter a specific pattern of values that you would like to enforce. This reduces the need to add extra validations on text fields. Using a input mask restricts the user to follow the pattern you define for entry into the field.
In the example below I set the Title field to the following mask.
The rules that the mask follows is this
- a is any alpha character A-Z, a-z no numbers or symbols
- 9 is any number 0-9
- Any other character or number would be considered fixed in the pattern.
- If you actually need to define a or 9 as a fixed character you need to escape those characters. For example; to set a fixed character "a" use \a and to make 9 a fixed character use \9
Below is how the above input mask would work on a new form.
And how it looks filled in.
Notice that when all the _ are filled it does not allow you to add more text than the pattern is set too.