- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on 02-29-2024 05:56 PM
What are masks?
They are a way to restrict the data users can input by enforcing specific formatting. Here are some examples: Zip code, credit card, phone.
#####-##
(###) ###-####
###-###
Why are they better than regex validation?
They compel users to input good data right away, eliminating the need for OnChange validation. Additionally, accessibility readers struggle to interpret error tooltips for fields.
How to set it up?
In this case, we'll configure it with a phone number in a catalog item.
1 - Navigate to the theme of your Service Portal.
2 - In the related list at the bottom of the page, look for 'JS Include' and click on New.
3 - Add the IMask record.
4 - Add a single-line phone number variable to the catalog item.
5 - Add a catalog OnLoad script and set the mask.
Note: sp_formfield_phone_number refers to the variable name, and the Isolate Script needs to be 'Yes'.
Result:
- 660 Views
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi, Guilherme
Can I create a mask like this directly in a field of the table?