Forum Discussion

BrettSchlagel-e's avatar
BrettSchlagel-e
Community Member
10 years ago

Copy Text Variable to Clipboard

I need some help. 

I need users to be able to click a button to copy a text variable to their clipboard, which can then be pasted in a word doc. This doesn't necessarily have to be done through a text variable, but is the only way I've come to think this will work.

In the past I used a text entry field that when published allows users to copy and paste the text by highlighting and right clicking as you normally would. I've been asked to eliminate that route and only use a one-click copy to clipboard button.

I was able to get this to work using JavaScript, however, this only worked in IE and I desperately need it to work in FireFox. I used the method below from another post to get it to work in IE:

Copy to Clipboard JS

I've sifted through post after post and haven't found anything that will work for this situation. If at all possible, this would be great if this worked with HTML5 as well.

Any help would be greatly appreciated. Thanks!