The CreatorCon Call for Content is officially open! Get started here.

Prevent pasting images in Type=HTML fields

Saeka
Kilo Sage

Hello,

 

I noticed that pasting an image into a Type=HTML field causes it to be immediately posted as an image in the activity.

Since there's a risk of unintended images saved to the clipboard being posted, is there a way to prevent image pasting altogether?

2 REPLIES 2

M Iftikhar
Giga Sage

@Saeka , This is expected behavior. When you paste an image into an HTML field, ServiceNow automatically attaches it and displays it in the activity stream.
If you want to disable image pasting, you can do so by adding a UI Script or onChange Client Script that blocks paste events for that field. 

Thanks & Regards,
Muhammad Iftikhar

If my response helped, please mark it as the accepted solution so others can benefit as well.

Saeka
Kilo Sage

@M Iftikhar , Thank you for your response. Would it be possible for you to provide a specific script?