Question
MD Cloud
US
Last activity: 15 Apr 2020 8:26 EDT
Javascript custom masks. How to write unmask value to clipboard?
We are using Pega 8.3.0. We have a custom js that adding masks to fields. We have to save unmask values to clipboard then when the form is submitting. Please, help us, how can we do this without redefinition submit js functions or smth like that. Thanks.
-
Likes (11)
Andrey Ostrovskiy Evgeniya Erysheva Georgy Kuskov Artem Verdyan Lina Dju and 6 More -
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Updated: 15 Apr 2020 8:26 EDT
Pegasystems Inc.
AU
Hi Andrey,
I would suggest to create a Hidden input for holding the unmasked value, While user is typing some value to masked field, create a onchange action of the masked input field and update the hidden input field, Hidden input field should point to Pega property.
Updated: 14 Jun 2021 7:38 EDT
Pegasystems Inc.
IN
If you are masking the entire text, then you can use Password control. Then unmask values will be stored in the clipboard.
MD Cloud
US
Thank u for reply. We have different mask values, for example internal codes, such 0-000-000, phone numbers and etc. Using a password control does not suit us. Entered value have to be visible for client.
Pegasystems Inc.
US
I'd be curious what others have to say, but you could try storing both the masked and unmasked values in the work object....?
I'm a little concerned that relying on client side js to format information might make things like reporting (both in the app and via services) more complicated. You'll also need a read-only version of the js for review harnesses and that sort of thing.
MD Cloud
US
Thank u for reply. We don't want to save both values. We need mask value only on UI, when user enter the value. For example phone number have to automaticaly cast to +0 (000) 000-00-00, but on the backend we have Proprietary information hidden. Or date time, when user enter date and time, separators like "." or ":" automaticaly added and the value cast to 00.00.0000 00:00, but on the backend we have normal pega value for datetime. We won't use mask values on backend for reporting or smth like that. We wanna save usual values for pega, but don't know how to trigger unmask on pega submit, because normaly $(selector).on('submit', function() { doesn't work.
Pegasystems Inc.
IN
Hello Andrey,
Did you check the Pega feature Edit-Input? Please refer below article for more information:
Regards,
Praveen
MD Cloud
US
Yes, of course. We want to do universal decision for any mask and any property. Perhaps this exists.
Accepted Solution
Updated: 15 Apr 2020 8:26 EDT
Pegasystems Inc.
AU
Hi Andrey,
I would suggest to create a Hidden input for holding the unmasked value, While user is typing some value to masked field, create a onchange action of the masked input field and update the hidden input field, Hidden input field should point to Pega property.
MD Cloud
US
Thank you for your reply. We have created custom control with logic that u have described and it works. Thanks a lot.