Forum Discussion

NickBellows's avatar
NickBellows
Qrew Member
4 years ago

Copy Button For Rich Text Formula Source Field

Hello,
I am trying to create a Copy Button field in my report based on the code below that was found in this thread.  The issue I am running into is the source field is a Rich Text Formula field.  When I use the code below it copies to the clipboard but in plain text with the HTML tags.  For example the field I want to Copy contains:

Begin
Task 
XXX
Description Text Here
Start Time: MMDDYY HHMM

but what ends up on the clipboard is <b>Begin</b><br><b>Task</b> XXX<br>Description Text Here<br><b>Start Time:</b> MMDDYY HHMM

Here is the code for the button:
var text CB= URLEncode([Teams]);
var text Alert= URLEncode("Activity Details" & " were Copied to the Clipboard");

"<a class='Vibrant Success' style=\"border:0px solid green; background-color:green; text-align: center;\"href=" &
"javascript:{" &
"navigator.clipboard.writeText('" & $CB & "').then(function(){" &
"},function(){" &
"});" &
"$.jGrowl('" & $Alert & "',{theme:'jGrowl-green'});" &
"};" &
">Copy to the Clipboard</a>"

Is the problem the Button Code?  Or is the problem my simplistic coding of the Rich Text Formula field to make it look the way I need it to look?  Not a coder, just looking for a quicker way to copy this data instead of highlighting, right click, copy, paste in the browser.

------------------------------
Nicholas Bellows
------------------------------
No RepliesBe the first to reply