- 12 Mar 2021
- 1 Minute to read
- Print
- DarkLight
Using a Custom Masked Textbox
- Updated on 12 Mar 2021
- 1 Minute to read
- Print
- DarkLight
Overview
Example Lab Details | |
Version | 6.4.0 |
Root Folder | Example Lab - Custom Mask Textbox |
Modules | None |
Dependencies | None |
This Example Lab Project demonstrates how to use a custom masked textbox to restrict a user entry to a 10 digit phone number.
Explanation
This project displays a Form with a textbox that will only accept a 10 digit number as an input from the user. This is accomplished by selecting "custom" when adding the textbox Form component to the Form grid in the properties panel. Selecting the "Custom" option allows the user to apply a custom mask to the textbox, restricting entry type and length. In this example the input will be restricted to a number, 10 digits long by using the following mask "^\d{3}\-?\d{7}$". Furthermore by filling in the "Custom Display Mask" textbox option with "999-9999999" the user will also be shown "___-_______" when filling in the textbox to conform to the typical formatting of a 10 digit phone number.