
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2022 11:28 PM - edited 10-19-2022 01:43 AM
On a Catalog Item I'm having a password variable that is encypted on submit.
In case the user unmasks the variable before, the user will see the change of the pin during submit, so I would like to mask it again before setting the encrypted pw ...
Could anyone please tell me how to?
In fact the user can click on the right side of the variable to mask/unmask ... but how to do this via catlog client script?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2022 06:00 AM
Hi@Zod ,
The only way to do what you're asking is to use DOM manipulation. I think this is why many or no one has replied. It's something that ServiceNow tries to steer user away from. (At least performing DOM manipulation on out-of-the-box components). One reason is that ServiceNow could change any of the CSS selectors that you could use to interact with that element at any time which would break after an update/upgrade.
With that said, you could use a different variable of type Custom and create your own masked element and use DOM manipulation on that since it will be your own component you shouldn't have to worry about it breaking on an upgrade/update.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2022 05:10 AM
No one???
@Chuck Tomasi easy one for you for sure 😉
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2022 06:00 AM
Hi@Zod ,
The only way to do what you're asking is to use DOM manipulation. I think this is why many or no one has replied. It's something that ServiceNow tries to steer user away from. (At least performing DOM manipulation on out-of-the-box components). One reason is that ServiceNow could change any of the CSS selectors that you could use to interact with that element at any time which would break after an update/upgrade.
With that said, you could use a different variable of type Custom and create your own masked element and use DOM manipulation on that since it will be your own component you shouldn't have to worry about it breaking on an upgrade/update.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2022 06:05 AM
Thank you. I was afraid of this answer.
But it is like it is. DOM manupulations we will not support .. so we have to live with it,