1
votes

I have users who manually copy text from a div element on our web application and paste it directly into a third party fat client. When the div contents are copied from IE, the text is stored in the Windows clipboard as Rich Text Format (in addition to other formats). The third party software then accepts the paste as Rich Text and the hidden data is causing errors in the software. Incidentally, Chrome does not store copied text as Rich Text, but rather as HTML Format which does not get used by the third party software, so our issue seems to be isolated to IE.

I discovered that text copied from input fields does not get stored as Rich Text, but using text inputs for this content is not ideal stylistically.

I haven't found a way to disable rich text from being copied out of a styled element. I am looking for any sort of hack that could help me achieve this that does not require any special action on the user's part.

I am using InsideClipboard to determine the formats being stored in the clipboard.

1
It is a similar issue, but I'm looking for a way to solve this within our application. The solutions in that thread require action by the user.Matt
what is your application doing to paste? could you handle it better there?Daniel A. White
Unfortunately it's not our application, so we don't have control over anything when they paste. This is occuring in third party off-the-shelf software that is integrated into our system.Matt

1 Answers

1
votes

I could not find a way to force the browser to avoid the Rich Text format from being copied to the clipboard in IE.

I worked around the problem by replacing the content with a text input only once the content is clicked, with the input value selected and ready to copy. On blur the page reverts back to the original state.